/* ====================================== */
/* REGISTRATION PAGE STYLES */
/* ====================================== */

:root {
    --primary-color: #069645;
    --primary-dark: #057a38;
    --primary-light: #e8f5ee;
    --secondary-color: #35c2c9;
    --accent-color: #35c2c9;
    --text-primary: #1a1a2e;
    --text-secondary: #666;
    --text-muted: #999;
    --background: linear-gradient(135deg, #069645 0%, #35c2c9 100%);
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --error-color: #dc3545;
    --error-bg: #fce8e6;
    --success-color: #28a745;
    --success-bg: #d4edda;
    --warning-color: #ffc107;
    --status-active: #28a745;
    --status-inactive: #dc3545;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@font-face {
    font-family: 'Gilroy';
    src: url('/assets/fonts/gilroy/Gilroy-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Gilroy';
    src: url('/assets/fonts/gilroy/Gilroy-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Gilroy';
    src: url('/assets/fonts/gilroy/Gilroy-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

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

/* ====================================== */
/* CONTAINER */
/* ====================================== */

.registration-container {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    max-width: 700px;
    width: 100%;
    margin: 20px auto;
    animation: fadeIn 0.5s ease-in-out;
}

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

/* ====================================== */
/* HEADER */
/* ====================================== */

.registration-header {
    transition: max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.3s, margin-bottom 0.4s;
    overflow: hidden;
    max-height: 300px;
    opacity: 1;
    text-align: center;
    margin-bottom: 30px;
}

.registration-header.hide {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
    pointer-events: none;
}

.logo-container {
    margin-bottom: 16px;
}

.logo {
    max-width: 120px;
    height: auto;
}

.app-title {
    font-family: 'Gilroy', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--primary-color);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.app-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
}

/* ====================================== */
/* AUTH/VERIFICATION SECTION */
/* ====================================== */

.auth-section {
    margin-bottom: 30px;
}

/* Info Box */
.info-box {
    display: flex;
    gap: 16px;
    background: var(--primary-light);
    border: 1px solid rgba(6, 150, 69, 0.2);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 24px;
}

.info-box svg {
    color: var(--primary-color);
    flex-shrink: 0;
    margin-top: 2px;
}

.info-content h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.info-content p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Verification Steps */
.verification-step {
    max-width: 400px;
    margin: 0 auto;
}

.step-heading {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    text-align: center;
}

.step-description {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 16px;
}

.email-display {
    background: #f5f5f5;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    text-align: center;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 20px;
}

/* OTP Input Container */
.otp-input-container {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 16px 0;
}

.otp-input {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: white;
    color: var(--text-primary);
    transition: all 0.2s ease;
    caret-color: var(--primary-color);
}

.otp-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(6, 150, 69, 0.1);
    transform: scale(1.05);
}

.otp-input.error {
    border-color: var(--error-color);
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* Primary Button */
.primary-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 8px;
}

.primary-btn:hover {
    background: var(--primary-dark);
}

.primary-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.primary-btn.loading .btn-text {
    display: none;
}

.primary-btn.loading .spinner {
    display: inline-block;
}

.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Resend Section */
.resend-section {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.resend-timer {
    font-size: 13px;
    color: var(--text-muted);
    transform: translateY(-1px);
}

/* Link Button */
.link-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 13px;
    cursor: pointer;
    padding: 8px 0;
    transition: var(--transition);
}

.link-btn:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.link-btn:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
    text-decoration: none;
}

#change-email-btn {
    display: block;
    margin: 16px auto 0;
}

/* Verified State */
.auth-verified {
    display: flex;
    justify-content: center;
}

.verified-info-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--success-bg);
    border: 1px solid rgba(40, 167, 69, 0.3);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    max-width: 350px;
    width: 100%;
}

.verified-icon {
    color: var(--success-color);
    flex-shrink: 0;
}

.verified-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.verified-label {
    font-size: 12px;
    color: var(--success-color);
    font-weight: 500;
}

.verified-email {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Error Message */
.error-message {
    color: var(--error-color);
    background: var(--error-bg);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-top: 16px;
    font-size: 14px;
    text-align: center;
}

/* ====================================== */
/* FORM SECTION */
/* ====================================== */

.form-section {
    position: relative;
}

/* Progress Container */
.progress-container {
    margin-bottom: 30px;
}

.progress-bar {
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 25%;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    cursor: pointer;
    opacity: 0.5;
    transition: var(--transition);
}

.progress-step.active,
.progress-step.completed {
    opacity: 1;
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.progress-step.active .step-circle {
    background: var(--primary-color);
    color: white;
}

.progress-step.completed .step-circle {
    background: var(--success-color);
    color: white;
}

.step-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
}

.progress-step.active .step-label {
    color: var(--primary-color);
    font-weight: 500;
}

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

.form-step.active {
    display: block;
    animation: slideIn 0.3s ease;
}

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

.step-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.step-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Form Groups */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    margin-bottom: 0px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-group label .required {
    color: var(--error-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(6, 150, 69, 0.1);
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: var(--error-color);
}

.form-group input:read-only {
    background: #f5f5f5;
    cursor: not-allowed;
    color: var(--text-secondary);
}

.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.7;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.field-error {
    font-size: 12px;
    color: var(--error-color);
    margin-top: 4px;
    min-height: 18px;
}

.field-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Subsections */
.subsection-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.guardian-section,
.school-section {
    margin-bottom: 10px;
}

/* ====================================== */
/* FORM NAVIGATION */
/* ====================================== */

.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    gap: 16px;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.prev-btn {
    background: white;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.prev-btn:hover {
    background: #f5f5f5;
    border-color: var(--text-secondary);
}

.next-btn {
    background: var(--primary-color);
    color: white;
    margin-left: auto;
}

.next-btn:hover {
    background: var(--primary-dark);
}

.submit-btn {
    background: var(--success-color);
    color: white;
    margin-left: auto;
}

.submit-btn:hover {
    background: #218838;
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.submit-btn.loading .spinner {
    display: inline-block;
    border-top-color: white;
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.submit-btn.loading svg {
    display: none;
}

/* ====================================== */
/* SUCCESS SECTION */
/* ====================================== */

.success-section {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    color: var(--success-color);
    margin-bottom: 24px;
}

.success-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.success-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.6;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 32px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.back-btn:hover {
    background: var(--primary-dark);
}

/* ====================================== */
/* SESSION EXPIRED SECTION */
/* ====================================== */

.session-expired-section {
    text-align: center;
    padding: 40px 20px;
}

.expired-icon {
    color: var(--warning-color);
    margin-bottom: 24px;
}

.expired-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.expired-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.6;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* ====================================== */
/* CONSENTS */
/* ====================================== */

.consent-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}
.consent-options {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.consent-option {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.consent-option:hover {
    border-color: var(--primary-color);
}

.consent-option input {
    accent-color: var(--primary-color);
}

.consent-option input:checked + span {
    color: var(--primary-color);
    font-weight: 500;
}

/* ====================================== */
/* RESPONSIVE STYLES */
/* ====================================== */

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .registration-container {
        padding: 24px 20px;
        margin: 10px auto;
        border-radius: var(--radius-md);
    }

    .app-title {
        font-size: 24px;
    }

    .logo {
        max-width: 100px;
    }
    .consent-options {
        flex-direction: column;
    }
    .consent-option {
        max-width: 120px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .progress-steps {
        flex-wrap: nowrap;
        gap: 4px;
    }

    .progress-step {
        min-width: auto;
        flex: 1;
    }

    .step-label {
        font-size: 9px;
        white-space: normal;
        line-height: 1.2;
    }

    .step-circle {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .form-navigation {
        flex-wrap: wrap;
    }

    .nav-btn {
        flex: 1;
        min-width: 120px;
    }

    .prev-btn {
        order: 1;
    }

    .next-btn,
    .submit-btn {
        order: 2;
    }

    .info-box {
        flex-direction: column;
        text-align: center;
    }

    .info-box svg {
        margin: 0 auto;
    }

    .verified-info-card {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }

    .verified-details {
        width: 100%;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .registration-container {
        padding: 20px 16px;
    }

    .step-title {
        font-size: 18px;
    }

    .form-group input,
    .form-group select{
        padding: 10px 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .form-group textarea {
        padding: 10px 12px;
        font-size: 12px; /* Prevents zoom on iOS */
    }

    .progress-step {
        min-width: auto;
        flex: 1;
    }
    
    .otp-input-container {
        gap: 8px;
    }
    
    .otp-input {
        width: 40px;
        height: 48px;
        font-size: 20px;
    }
}
