/* QR Fix Passwordless Authentication Styles */

:root {
    --auth-primary: #7a39ff;
    --auth-primary-light: #897FFF;
    --auth-primary-hover: #4A3AFF;
    --auth-dark: #170F49;
    --auth-gradient: linear-gradient(180deg, #897FFF 0%, #4A3AFF 100%);
}

.qrfix-auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--auth-dark);
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    position: relative;
}

.qrfix-auth-box {
    background: white;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.qrfix-step {
    display: none;
    animation: fadeIn 0.4s ease;
}

.qrfix-step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.qrfix-auth-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.qrfix-logo {
    display: inline-block;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.qrfix-auth-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--auth-dark);
    margin: 0 0 8px 0;
}

.qrfix-auth-header p {
    font-size: 15px;
    color: #6B7280;
    margin: 0;
}

.qrfix-email-highlight {
    color: var(--auth-primary);
    font-weight: 600;
}

.qrfix-back-btn {
    position: absolute;
    left: 0;
    top: 0;
    background: none;
    border: none;
    color: var(--auth-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.qrfix-back-btn:hover {
    background: rgba(122, 57, 255, 0.08);
}

.qrfix-form {
    margin-top: 30px;
}

.qrfix-form-group {
    margin-bottom: 24px;
}

.qrfix-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}

.qrfix-form-group input {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.qrfix-form-group input:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 4px rgba(122, 57, 255, 0.1);
}

.qrfix-input-hint {
    display: block;
    font-size: 13px;
    color: #a0aec0;
    margin-top: 6px;
}

/* OTP Input Fields */
.qrfix-otp-inputs {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.otp-digit {
    width: 50px !important;
    height: 56px;
    text-align: center;
    font-size: 24px !important;
    font-weight: 700;
    padding: 0 !important;
}

.otp-digit:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 4px rgba(122, 57, 255, 0.1);
}

/* Buttons */
.qrfix-btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.qrfix-btn-primary {
    background: var(--auth-gradient);
    color: white;
    box-shadow: 0px 3px 4px 0px rgba(223, 229, 255, 0.3) inset, 0px 1px 1px 0px rgba(255, 255, 255, 0.35) inset, 0px -2px 2px 0px rgba(80, 70, 189, 0.6) inset, 0px 2px 3px 0px rgba(55, 52, 209, 0.2);
}

.qrfix-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(122, 57, 255, 0.3);
}

.qrfix-btn-primary:active {
    transform: translateY(0);
}

.qrfix-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.qrfix-btn-outline {
    background: white;
    color: var(--auth-primary);
    border: 2px solid var(--auth-primary);
}

.qrfix-btn-outline:hover {
    background: rgba(122, 57, 255, 0.05);
}

/* Social Buttons */
.qrfix-social-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 25px;
}

.qrfix-btn-social {
    background: white;
    color: #2d3748;
    border: 2px solid #e2e8f0;
    padding: 12px 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.qrfix-btn-social:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

.qrfix-btn-google:hover {
    border-color: #4285F4;
    background: #f8f9ff;
}

.qrfix-btn-facebook:hover {
    border-color: #1877F2;
    background: #f5f8ff;
}

/* Divider */
.qrfix-divider {
    position: relative;
    text-align: center;
    margin: 25px 0;
}

.qrfix-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e2e8f0;
}

.qrfix-divider span {
    position: relative;
    background: white;
    padding: 0 15px;
    font-size: 13px;
    color: #a0aec0;
    font-weight: 500;
}

/* Loading Spinner */
.btn-loader {
    position: absolute;
}

.spinner {
    animation: rotate 1s linear infinite;
    width: 20px;
    height: 20px;
}

.spinner circle {
    stroke: white;
    stroke-linecap: round;
    stroke-dasharray: 1, 200;
    stroke-dashoffset: 0;
    animation: dash 1.5s ease-in-out infinite;
    fill: none;
    stroke-width: 4;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 200;
        stroke-dashoffset: 0;
    }

    50% {
        stroke-dasharray: 89, 200;
        stroke-dashoffset: -35;
    }

    100% {
        stroke-dasharray: 89, 200;
        stroke-dashoffset: -124;
    }
}

/* Messages */
.qrfix-message {
    margin-top: 20px;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 14px;
    display: none;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.qrfix-message.success {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
    display: block;
}

.qrfix-message.error {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #fc8181;
    display: block;
}

/* Resend Section */
.qrfix-resend {
    text-align: center;
    margin-top: 25px;
}

.qrfix-resend p {
    font-size: 14px;
    color: #718096;
    margin: 0 0 8px 0;
}

.qrfix-link-btn {
    background: none;
    border: none;
    color: var(--auth-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    transition: color 0.2s;
}

.qrfix-link-btn:hover {
    color: var(--auth-primary-hover);
}

.qrfix-link-btn:disabled {
    color: #a0aec0;
    cursor: not-allowed;
    text-decoration: none;
}

#resend-timer {
    color: #718096;
    font-size: 14px;
}

/* Terms */
.qrfix-terms {
    margin-top: 25px;
    text-align: center;
}

.qrfix-terms p {
    font-size: 12px;
    color: #a0aec0;
    margin: 0;
}

.qrfix-terms a {
    color: var(--auth-primary);
    text-decoration: none;
}

.qrfix-terms a:hover {
    text-decoration: underline;
}

/* Welcome Screen */
.qrfix-welcome-icon {
    margin-bottom: 20px;
}

/* Trust Badge */
.qrfix-trust-badge {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.qrfix-trust-badge svg {
    fill: rgba(255, 255, 255, 0.9);
}

/* Logged In State */
.qrfix-logged-in {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 420px;
    margin: 0 auto;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.qrfix-logged-in p {
    font-size: 18px;
    color: #2d3748;
    margin-bottom: 25px;
}

.qrfix-logged-in .qrfix-btn {
    margin-bottom: 12px;
}

/* Responsive Design */
@media (max-width: 640px) {
    .qrfix-auth-box {
        padding: 30px 20px;
    }

    .qrfix-auth-header h2 {
        font-size: 24px;
    }

    .qrfix-social-buttons {
        grid-template-columns: 1fr;
    }

    .qrfix-otp-inputs {
        gap: 8px;
    }

    .otp-digit {
        width: 42px !important;
        height: 48px;
        font-size: 20px !important;
    }

    .qrfix-trust-badge {
        font-size: 12px;
    }
}

/* Animations for smooth transitions */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.qrfix-auth-box {
    animation: fadeInUp 0.6s ease;
}

/* Focus styles for accessibility */
*:focus-visible {
    outline: 2px solid var(--auth-primary);
    outline-offset: 2px;
}

/* Auto-fill styles */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-text-fill-color: #2d3748;
    -webkit-box-shadow: 0 0 0px 1000px white inset;
    transition: background-color 5000s ease-in-out 0s;
    border: 2px solid var(--auth-primary);
}