/**
 * Storefront Auth Pages Stylesheet
 * Shared styles for login, register, forgot password, reset password, setup account
 * Ferguson.com-inspired design using storefront CSS tokens
 */

/* Auth Page Layout */
.sf-auth-wrapper {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

/* Mobile overrides moved to end of file for proper cascade */

/* Left: Hero Panel */
.sf-auth-hero {
    background: linear-gradient(135deg, var(--sf-navy) 0%, var(--sf-navy-dark) 100%);
    color: var(--sf-white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}


.sf-auth-hero-content {
    position: relative;
    z-index: 1;
    max-width: 420px;
}

.sf-auth-hero-logo {
    margin-bottom: 3rem;
}

.sf-auth-hero-logo img {
    max-height: 45px;
    width: auto;
    filter: brightness(0) invert(1);
}

.sf-auth-hero-logo-text {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.sf-auth-hero h2 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.sf-auth-hero p {
    font-size: 1.1rem;
    opacity: 0.85;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.sf-auth-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sf-auth-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    font-size: 0.95rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sf-auth-features li:last-child {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sf-auth-features i {
    color: var(--sf-orange);
    font-size: 1.1rem;
    width: 24px;
}

/* Right: Form Panel */
.sf-auth-form-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 3rem;
    background: var(--sf-gray-50);
    overflow-y: auto;
}

.sf-auth-form-container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.sf-auth-mobile-logo {
    display: none;
    margin-bottom: 2rem;
}

@media (max-width: 900px) {
    .sf-auth-mobile-logo {
        display: block;
        text-align: center;
    }

    .sf-auth-mobile-logo img {
        max-height: 40px;
    }

    .sf-auth-mobile-logo-text {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--sf-navy);
    }
}

.sf-auth-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--sf-gray-600);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-decoration: none;
    transition: color 0.2s;
}

.sf-auth-back:hover {
    color: var(--sf-blue);
    text-decoration: none;
}

.sf-auth-card {
    background: var(--sf-white);
    border: 1px solid var(--sf-gray-200);
    border-radius: var(--sf-radius-lg);
    box-shadow: var(--sf-shadow-md);
    padding: 2rem 2.5rem;
}

.sf-auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--sf-gray-900);
    margin: 0 0 0.5rem;
}

.sf-auth-subtitle {
    color: var(--sf-gray-600);
    margin-bottom: 1.75rem;
    font-size: 0.95rem;
}

/* Form Elements */
.sf-form-group {
    margin-bottom: 1rem;
}

.sf-form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 500px) {
    .sf-form-row-2 {
        grid-template-columns: 1fr;
    }
}

.sf-form-label {
    display: block;
    font-weight: 600;
    color: var(--sf-gray-800);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.sf-form-label .optional {
    font-weight: 400;
    color: var(--sf-gray-500);
}

.sf-form-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--sf-gray-300);
    border-radius: var(--sf-radius);
    font-size: 1rem;
    font-family: var(--sf-font);
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--sf-white);
    box-sizing: border-box;
}

.sf-form-input:focus {
    outline: none;
    border-color: var(--sf-blue);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.12);
}

.sf-form-input.error {
    border-color: var(--sf-error);
}

.sf-form-hint {
    font-size: 0.8rem;
    color: var(--sf-gray-500);
    margin-top: 4px;
}

.sf-form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* Toggle Switch */
.sf-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.sf-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.sf-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--sf-gray-300);
    border-radius: 24px;
    transition: background-color 0.25s ease;
}

.sf-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.sf-toggle input:checked+.sf-toggle-slider {
    background-color: var(--sf-blue);
}

.sf-toggle input:checked+.sf-toggle-slider:before {
    transform: translateX(20px);
}

.sf-toggle input:focus+.sf-toggle-slider {
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

/* Password Strength */
.sf-password-strength {
    height: 4px;
    background: var(--sf-gray-200);
    border-radius: 4px;
    margin-top: 8px;
    overflow: hidden;
}

.sf-password-strength-bar {
    height: 100%;
    width: 0;
    transition: width 0.3s, background 0.3s;
    border-radius: 4px;
}

/* Buttons */
.sf-btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--sf-blue);
    color: var(--sf-white);
    border: none;
    border-radius: var(--sf-radius);
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--sf-font);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 1.5rem;
}

.sf-btn-primary:hover:not(:disabled) {
    background: var(--sf-blue-hover);
}

.sf-btn-primary:active:not(:disabled) {
    transform: translateY(1px);
}

.sf-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.sf-btn-secondary {
    width: 100%;
    padding: 12px;
    background: transparent;
    color: var(--sf-gray-600);
    border: 1px solid var(--sf-gray-300);
    border-radius: var(--sf-radius);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--sf-font);
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1rem;
}

.sf-btn-secondary:hover {
    background: var(--sf-gray-100);
    border-color: var(--sf-gray-400);
}

/* Alerts */
.sf-alert {
    padding: 12px 16px;
    border-radius: var(--sf-radius);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    display: none;
}

.sf-alert.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--sf-error);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sf-alert.success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: var(--sf-success);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sf-alert.info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.sf-alert.info i {
    font-size: 1.5rem;
    margin-top: 2px;
}

.sf-alert-content {
    flex: 1;
}

.sf-alert-title {
    font-weight: 700;
    margin-bottom: 4px;
}

/* Required field indicator */
.sf-required {
    color: var(--sf-error);
    font-weight: 600;
}

/* Divider */
.sf-auth-divider {
    text-align: center;
    margin: 1.75rem 0;
    position: relative;
}

.sf-auth-divider::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: var(--sf-gray-200);
}

.sf-auth-divider span {
    background: var(--sf-white);
    padding: 0 1rem;
    color: var(--sf-gray-500);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
}

/* Footer */
.sf-auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.95rem;
    color: var(--sf-gray-600);
}

.sf-auth-footer a {
    color: var(--sf-blue);
    font-weight: 600;
}

/* Terms */
.sf-terms {
    font-size: 0.8rem;
    color: var(--sf-gray-500);
    margin-top: 1rem;
    line-height: 1.5;
}

.sf-terms a {
    color: var(--sf-blue);
}

/* Spinner */
.sf-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--sf-white);
    border-radius: 50%;
    animation: sf-spin 0.8s linear infinite;
}

@keyframes sf-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Form Toggle Animation */
.sf-form-section {
    display: none;
}

.sf-form-section.active {
    display: block;
    animation: sf-fade-in 0.3s ease-out;
}

@keyframes sf-fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Forgot Link */
.sf-forgot-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--sf-blue);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    text-decoration: none;
}

.sf-forgot-link:hover {
    text-decoration: underline;
}

/* Email check inline status */
.sf-email-wrapper {
    position: relative;
}

.sf-email-wrapper .sf-form-input {
    padding-right: 40px;
}

.sf-email-status {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
}

.sf-email-status.checking {
    color: #6b7280;
}

.sf-email-status.available {
    color: #10b981;
}

.sf-email-status.has-account,
.sf-email-status.needs-setup {
    color: #3b82f6;
}

/* Account Found Banner */
.sf-account-found {
    background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
    border: 1px solid #93c5fd;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 24px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sf-account-found-icon {
    width: 48px;
    height: 48px;
    background: #3b82f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.sf-account-found-content {
    flex: 1;
}

.sf-account-found-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 6px;
}

.sf-account-found p {
    color: #1e3a5f;
    font-size: 0.9rem;
    margin-bottom: 12px;
    line-height: 1.5;
}

/* Has account message - premium style */
.sf-has-account-msg {
    background: linear-gradient(135deg, #fef9e7 0%, #fffbf0 100%);
    border: 1px solid #f5d675;
    border-radius: 12px;
    padding: 16px 20px;
    font-size: 0.9rem;
    color: #7a5c00;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.sf-has-account-msg::before {
    content: "\f05a";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 1.5rem;
    color: #d4a50a;
    flex-shrink: 0;
}

.sf-has-account-msg-content {
    flex: 1;
}

.sf-has-account-msg-title {
    font-weight: 700;
    color: #5c4500;
    margin-bottom: 4px;
}

.sf-has-account-msg-text {
    font-size: 0.85rem;
    color: #7a5c00;
    line-height: 1.5;
}

.sf-has-account-msg a {
    color: #996d00;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dotted #996d00;
    transition: all 0.2s;
}

.sf-has-account-msg a:hover {
    color: #7a5c00;
    border-bottom-style: solid;
}

/* Hide reCAPTCHA badge - using invisible recaptcha v3 */
.grecaptcha-badge {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Centered auth layout (for forgot password page) */
.sf-auth-centered {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, var(--sf-gray-50) 0%, var(--sf-gray-100) 100%);
}

.sf-auth-container {
    width: 100%;
    max-width: 440px;
}

.sf-auth-logo {
    display: block;
    text-align: center;
    margin-bottom: 2rem;
    text-decoration: none;
}

.sf-auth-logo img {
    max-height: 45px;
}

.sf-auth-logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--sf-navy);
}

.sf-auth-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--sf-blue) 0%, var(--sf-navy) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.sf-auth-icon i {
    font-size: 28px;
    color: var(--sf-white);
}

/* Hero icon for reset password */
.sf-auth-hero-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.sf-auth-hero-icon i {
    font-size: 2rem;
    color: var(--sf-orange);
}

/* Centered title/subtitle variants */
.sf-auth-centered .sf-auth-title {
    text-align: center;
}

.sf-auth-centered .sf-auth-subtitle {
    text-align: center;
    margin-bottom: 2rem;
    line-height: 1.5;
}

/* Success Icon */
.sf-success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 2.5rem;
}

/* Checkbox label for auth */
.sf-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    color: var(--sf-gray-700);
    cursor: pointer;
}

/* Welcome banner for setup account */
.sf-welcome-banner {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1px solid #86efac;
    border-radius: var(--sf-radius);
    padding: 16px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.sf-welcome-banner i {
    color: var(--sf-success);
    font-size: 1.5rem;
    margin-top: 2px;
}

.sf-welcome-content h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #166534;
    margin: 0 0 4px;
}

.sf-welcome-content p {
    font-size: 0.875rem;
    color: #15803d;
    margin: 0;
    line-height: 1.4;
}

/* Disabled form input */
.sf-form-input:disabled {
    background: var(--sf-gray-100);
    color: var(--sf-gray-600);
    cursor: not-allowed;
}

/* Claim Account Modal */
.sf-claim-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.sf-claim-modal {
    background: var(--sf-white);
    border-radius: var(--sf-radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
    animation: sf-modal-in 0.3s ease-out;
}

@keyframes sf-modal-in {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.sf-claim-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--sf-gray-100);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--sf-gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.sf-claim-close:hover {
    background: var(--sf-gray-200);
    color: var(--sf-gray-900);
}

.sf-claim-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.sf-claim-icon {
    font-size: 3rem;
    color: var(--sf-success);
    margin-bottom: 1rem;
}

.sf-claim-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--sf-gray-900);
    margin: 0 0 0.5rem;
}

.sf-claim-header p {
    color: var(--sf-gray-600);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

/* ==========================================================================
   RESPONSIVE — Must be at end for proper cascade priority
   ========================================================================== */

@media (max-width: 900px) {
    .sf-auth-wrapper {
        grid-template-columns: 1fr;
    }

    /* Hide marketing hero panel on mobile — form only */
    .sf-auth-hero {
        display: none !important;
    }
}