/* Registration Page Styles - Updated to match Profile Settings */

/* Import CSS Custom Properties matching Settings */
/* Reset body for auth page */
body {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    font-family: var(--font-primary) !important;
    overflow-y: auto !important;
    /* Force scroll */
    overflow-x: hidden !important;
    height: auto !important;
    /* Allow body to grow */
    min-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    /* Start from top */
    align-items: center !important;
    width: 100%;
}

/* Back Navigation (Top Left) */
.back-nav-register a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: var(--text-sm);
    position: fixed;
    top: 20px;
    left: calc(var(--app-container-gutter-inline) + 20px);
    z-index: var(--z-header);
    transition: color var(--transition-fast);
    cursor: pointer;
}

.back-nav-register a:hover {
    color: var(--text-muted);
}

/* Container and Layout */
.register-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 50px var(--space-lg) 50px;
    /* Add space for fixed progress bar */
    background-color: var(--bg-primary);
    width: 100%;
    /* Ensure width */
}

/* Registration Progress Bar */
.registration-progress-bar {
    position: fixed;
    top: 0;
    left: var(--app-container-gutter-inline);
    right: var(--app-container-gutter-inline);
    width: auto;
    height: 4px;
    background-color: var(--bg-tertiary);
    z-index: var(--z-header);
    overflow: hidden;
}

.registration-progress-fill {
    height: 100%;
    width: 20%;
    background-color: var(--bg-secondary);
    transition: width 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
    border-radius: 0;
}

/* Form Container - Matching settings.css card style */
.form-container {
    max-width: 600px;
    width: 100%;
}

/* Form Steps */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeIn var(--transition-normal);
}

.form-step.fade-out {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity var(--transition-normal), transform var(--transition-normal);
}

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

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

.form-step h2 {
    font-size: var(--text-xl);
    font-weight: var(--font-weight-regular);
    color: var(--text-primary);
    margin-bottom: 12px;
}

.step-description {
    color: var(--text-muted);
    font-size: var(--text-base);
    margin-bottom: var(--space-lg);
    line-height: var(--line-height-normal);
}

/* Form Groups */
.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
    font-size: var(--text-xs);
    font-weight: var(--font-weight-medium);
}

/* Inputs - Updated to match profile settings style */
/* Styles handled globally in components/forms.css */

/* Password Requirements Checklist */
.password-requirements {margin-top: 12px;
    padding: var(--space-md);
    background-color: var(--bg-secondary);
    border-radius: var(--radius-standard)}

.requirement-item {
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all var(--transition-fast);
}

.requirement-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: var(--text-xs);
    font-weight: bold;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.requirement-text {
    font-size: var(--text-xs);
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

/* Completed requirement styling */
.requirement-item.completed .requirement-icon {
    color: var(--status-success-fg);
}

.requirement-item.completed .requirement-icon::before {
    content: "âœ“";
}

.requirement-item.completed .requirement-text {
    color: var(--status-success-fg);
}

/* Error States */
input[type="text"].error,
input[type="email"].error,
input[type="password"].error {
    color: var(--color-accent) !important;
}

input[type="text"].error::placeholder,
input[type="email"].error::placeholder,
input[type="password"].error::placeholder {
    color: var(--color-accent) !important;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-md);
    margin-top: var(--space-md);

}

.form-actions .btn {
    min-width: 120px;
}

.form-actions .btn:only-child {
    margin-left: auto;
}

.entry-step-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin: var(--space-md) 0;
}

.auth-error {
    margin-top: 12px;
    color: var(--status-error-fg);
    font-size: var(--text-sm);
    text-align: center;
    min-height: 18px;
}

.register-error-message {
    margin-bottom: 0;
}

.auth-inline-link {
    color: var(--status-info-fg);
    text-decoration: underline;
    margin-left: var(--space-xs);
}

.auth-inline-link:hover {
    color: var(--text-primary);
}

.auth-support-links {
    margin-top: var(--space-md);
    text-align: center;
}

.auth-support-links p {
    margin: 0;
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.auth-support-links .reset-password-link {
    color: var(--status-info-fg);
    text-decoration: underline;
    font-weight: var(--font-weight-medium);
    margin-left: var(--space-xs);
}

.auth-support-links .reset-password-link:hover {
    color: var(--text-primary);
}

.auth-oauth-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin: var(--space-md) 0;
}

.auth-oauth-actions .btn {
    width: 100%;
}

.preferences-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: var(--space-xs) 0;
}

.preference-option {
    padding: 12px 16px;
    border-radius: var(--radius-standard);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    font-size: var(--text-xs);
    font-weight: var(--font-weight-medium);
    transition: all var(--transition-fast);
    user-select: none;
    text-align: center;
    flex: 0 0 auto;
}

.preference-option:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.preference-option.selected {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 968px) {
    .register-container {
        padding: var(--space-lg);
    }
}

@media (max-width: 768px) {
    .form-container {
        padding: var(--space-lg);
        margin-top: 20px;
    }

    .form-title {
        font-size: var(--text-xl);
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .form-actions .btn:only-child {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .register-container {
        padding-top: 20px;
        /* Reduce top padding on mobile */
    }
}

/* Language Selection Styles - Updated to match profile settings */
.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23EEFDF9' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

/* Dropdown options styling for select elements */
.form-control option {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: var(--space-sm);
}

/* Terms Agreement */
.terms-agreement {
    padding: 14px;
    border: hidden;
    border-radius: var(--radius-standard);
}

.terms-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    gap: 10px;
    margin: 0;
}

.terms-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 3px;
    cursor: pointer;
    accent-color: var(--status-info-fg);
    flex-shrink: 0;
}

.terms-text {
    font-size: var(--text-sm);
    color: var(--text-muted);
    line-height: 1.5;
    flex: 1;
}

.terms-text a {
    color: var(--status-info-fg);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    transition: color var(--transition-fast);
}

.terms-text a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* Email Consent Section */
.email-consent-section {
    margin: var(--space-lg) 0 0 0;
    padding: var(--space-md);
    border-radius: var(--radius-standard);
}

.consent-info-text {
    font-size: var(--text-xs);
    color: var(--text-primary);
    line-height: 1.5;
    margin: 0 0 10px 0;
}

.consent-learn-more {
    color: var(--status-info-fg);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    margin-left: 6px;
    white-space: nowrap;
}

.consent-learn-more:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.marketing-consent-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    gap: 10px;
    margin: 0;
}

.marketing-consent-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--status-info-fg);
    flex-shrink: 0;
}

.marketing-consent-text {
    font-size: var(--text-xs);
    color: var(--text-muted);
    line-height: 1.5;
    flex: 1;
}

/* ===== MODERN STEP CONTAINER (All Steps) ===== */
.modern-step-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: calc(100vh - 200px);
}

.modern-step-title {
    font-size: var(--text-xl);
    font-weight: var(--font-weight-regular);
    color: var(--text-primary);
    text-align: center;
    margin: 0 0 12px 0;
    line-height: 1.2;
}

.modern-step-subtitle {
    font-size: var(--text-base);
    color: var(--text-muted);
    text-align: center;
    margin: 0 0 32px 0;
    line-height: 1.5;
}

.modern-form-group {
    margin-bottom: 20px;
}

.email-edit-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--status-info-fg);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-regular);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.email-edit-btn:hover {
    color: var(--text-primary);
}

.password-input-wrapper {
    position: relative;
}

.modern-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 10px;
}

.modern-input.with-toggle {
    padding-right: 46px;
}

.modern-input.with-inline-edit {
    padding-right: 90px;
}

.modern-input[readonly] {
    cursor: default;
    opacity: 0.85;
}

.inline-edit-field {
    position: relative;
}

.inline-edit-field .inline-edit-button {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    color: var(--text-primary);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-regular);
    cursor: pointer;
    z-index: var(--z-base);
}

.inline-edit-field .inline-edit-button:hover {
    opacity: 0.85;
}

.password-toggle-btn {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.password-toggle-btn:hover {
    opacity: 1;
}

.password-toggle-icon {
    width: 20px;
    height: 20px;
    filter: invert(1);
}

.caps-lock-warning {
    display: none;
    align-items: center;
    gap: var(--space-sm);
    color: var(--status-warning-fg);
    font-size: var(--text-xs);
    margin-top: var(--space-sm);
    font-weight: var(--font-weight-medium);
    animation: fadeIn var(--transition-normal);
}

.modern-input.error {
    /* Border removed - errors shown via placeholder color */
}

/* ===== STEP 2: COMPACT PASSWORD REQUIREMENTS ===== */
.password-requirements-compact {margin-top: var(--space-sm)}

.password-requirements-compact .requirement-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--text-xs);
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.password-requirements-compact .requirement-item.completed {
    color: var(--status-success-fg);
}

.password-requirements-compact .requirement-icon {
    font-size: var(--text-xs);
    transition: all var(--transition-fast);
}

.password-requirements-compact .requirement-item.completed .requirement-icon {
    font-size: 0;
    /* Hide the original â—‹ character */
}

.password-requirements-compact .requirement-item.completed .requirement-icon::before {
    content: "â—";
    font-size: var(--text-xs);
    /* Restore font size for the filled circle */
}

.auth-success-modal-overlay {
    position: fixed;
    inset: 0 var(--app-container-gutter-inline);
    background-color: var(--color-overlay-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal-backdrop);
    font-family: var(--font-primary);
    backdrop-filter: blur(4px);
}

.auth-success-modal {
    background-color: var(--bg-secondary);
    padding: 50px 40px;
    border-radius: var(--radius-standard);
    text-align: center;
    max-width: 400px;
    width: 90%;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.auth-success-modal-top {
    margin-bottom: var(--space-xl);
}

.auth-success-modal-icon {
    width: 60px;
    height: 60px;
    background-color: var(--surface-info-bg);
    color: var(--surface-info-text);
    border-radius: var(--radius-standard);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-lg);
}

.auth-success-modal-title {
    color: var(--text-primary);
    margin: 0 0 var(--space-md);
    font-size: var(--text-xl);
    font-weight: var(--font-weight-regular);
    line-height: 1.3;
}

.auth-success-modal-message {
    color: var(--text-muted);
    margin: 0 0 40px;
    font-size: var(--text-base);
    line-height: var(--line-height-normal);
}

.auth-success-modal-action {
    background-color: var(--text-primary);
    color: var(--bg-primary);
    padding: 14px 40px;
    border: 1px solid var(--text-primary);
    border-radius: var(--radius-pill);
    font-size: var(--text-base);
    font-weight: var(--font-weight-regular);
    cursor: pointer;
    transition:
        background-color var(--transition-fast),
        border-color var(--transition-fast),
        color var(--transition-fast),
        transform var(--transition-fast);
}

.auth-success-modal-action:hover {
    background-color: var(--text-primary);
    border-color: var(--text-primary);
    transform: translateY(-1px);
}

/* ===== MOBILE RESPONSIVENESS ===== */
@media (max-width: 768px) {

    /* Step Titles */
    .modern-step-title {
        font-size: var(--text-xl);
    }

    .modern-step-subtitle {
        font-size: var(--text-sm);
        margin-bottom: var(--space-lg);
    }

    .modern-step-container {
        padding: 10px 0;
        min-height: calc(100vh - 150px);
    }

    /* Form Inputs */
    .modern-input {
        padding: 10px 14px;
        font-size: var(--text-base);
        /* Prevents iOS zoom on focus */
    }

    .modern-form-group {
        margin-bottom: var(--space-md);
    }

    /* Password Requirements */
    .password-requirements-compact {
        gap: 6px;
    }

    .password-requirements-compact .requirement-item {
        font-size: var(--text-xs);
    }

    /* Terms Agreement */
    .terms-agreement {
        padding: 12px;
    }

    .terms-text {
        font-size: var(--text-xs);
    }

    /* Form Actions */
    .form-actions {
        gap: 10px;
    }
}

@media (max-width: 480px) {

    .modern-step-title {
        font-size: var(--text-xl);
    }

    .modern-form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

}

/* Extra breakpoint for very small screens like 375px */
@media (max-width: 400px) {

    /* Back button - Ensure visibility */
    .back-nav-register a {
        top: 12px;
        left: 12px;
        font-size: var(--text-sm);
    }

    /* Register container - Better padding */
    .register-container {
        padding: 20px 0px 20px 0px;
    }
}
