/* frontend-user/css/signup.css */

/* ===== MULTI-STEP FORM STYLES ===== */

.form-container {
    max-width: 650px;
    margin: 2rem auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    text-align: center;
}

.step-indicator {
    text-align: center;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 2rem;
    padding: 0.5rem;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 9999px;
    font-size: 0.9rem;
}

/* Step transitions */
.step {
    animation: fadeSlide 0.4s ease;
}

@keyframes fadeSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== FORM GROUPS ===== */

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-row .half {
    flex: 1;
    margin-bottom: 0;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

input, select, textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s ease;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input.error {
    border-color: var(--danger);
}

input.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* ===== PASSWORD REVEAL BUTTON ===== */

.reveal-btn {
    position: absolute;
    right: 1rem;
    top: 2.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.1rem;
    transition: color 0.2s;
}

.reveal-btn:hover {
    color: var(--accent);
}

/* ===== PASSWORD STRENGTH METER ===== */

.strength-meter {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    overflow: hidden;
    position: relative;
}

.strength-meter .fill {
    height: 100%;
    transition: width 0.3s ease;
}

.strength-meter.strength-weak .fill {
    width: 33%;
    background: var(--danger);
}

.strength-meter.strength-medium .fill {
    width: 66%;
    background: var(--warning);
}

.strength-meter.strength-strong .fill {
    width: 100%;
    background: var(--success);
}

/* Password strength text (optional) */
.strength-text {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    color: var(--text-muted);
}

/* ===== CHECKBOX STYLES ===== */

.form-group.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.form-group.checkbox label {
    margin-bottom: 0;
    font-weight: normal;
    font-size: 0.9rem;
}

.form-group.checkbox input[type="checkbox"] {
    width: auto;
    margin-top: 0.2rem;
    accent-color: var(--accent);
}

/* ===== ERROR MESSAGES ===== */

.error-message {
    color: var(--danger);
    font-size: 0.75rem;
    margin-top: 0.25rem;
    min-height: 1.2rem;
}

/* ===== HELPER TEXT ===== */

small, .small {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ===== BUTTON GROUP ===== */

.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: space-between;
}

.button-group button {
    flex: 1;
    padding: 0.875rem;
    font-size: 1rem;
    font-weight: 600;
}

/* ===== STEP 3 SUCCESS STYLES ===== */

.success-icon {
    font-size: 4rem;
    text-align: center;
    margin: 1rem 0;
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

#step3 h2 {
    margin: 1rem 0;
    color: var(--success);
}

#step3 p {
    margin: 1rem 0 2rem;
    color: var(--text-secondary);
}

#countdown {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--accent);
}

/* ===== INSTRUCTION TEXT ===== */

.instruction {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    border-left: 4px solid var(--accent);
    color: var(--text-secondary);
}

/* ===== FOOTER STYLES ===== */

footer {
    margin-top: 2rem;
    text-align: center;
}

footer .btn-text {
    color: var(--text-muted);
    font-size: 0.9rem;
}

footer .btn-text:hover {
    color: var(--accent);
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */

@media (max-width: 640px) {
    .form-container {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .button-group button {
        width: 100%;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .reveal-btn {
        top: 2.3rem;
    }
}

/* ===== DARK THEME ADJUSTMENTS ===== */

.dark-theme input,
.dark-theme select,
.dark-theme textarea {
    background-color: var(--bg-secondary);
    border-color: var(--border-dark);
}

.dark-theme .instruction {
    background-color: rgba(37, 99, 235, 0.2);
}

.dark-theme .step-indicator {
    background: rgba(37, 99, 235, 0.2);
}

/* ===== LOADING STATE ===== */

.form-container.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.form-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ===== ANIMATIONS ===== */

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== SECURITY QUESTIONS SECTION ===== */

#step2 .form-group {
    margin-bottom: 1.5rem;
}

#step2 label {
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

#step2 input {
    background: var(--bg-secondary);
}

/* ===== SUCCESS STEP STYLES ===== */

#step3 {
    text-align: center;
    padding: 2rem 1rem;
}

#step3 .btn-primary {
    margin-top: 1.5rem;
    min-width: 200px;
}

/* ===== AUTO-SAVE INDICATOR (if used) ===== */

.auto-save-indicator {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    background: var(--success);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    box-shadow: var(--shadow);
    animation: slideUp 0.3s ease;
    z-index: 1000;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== TERMS LINK STYLES ===== */

.form-group.checkbox a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.form-group.checkbox a:hover {
    text-decoration: underline;
}

/* ===== DISABLED STATE ===== */

button:disabled,
input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== FOCUS VISIBLE FOR ACCESSIBILITY ===== */

*:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}