/* =========================
   CSS VARIABLES
========================= */
:root {
    --primary-blue: #2563eb;
    --dark-blue: #1e40af;
    --light-blue: #dbeafe;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --white: #ffffff;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --error-color: #ef4444;

    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* =========================
   RESET & BASE
========================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    min-height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #2563eb, #1d4ed8, #1e40af);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.75rem;
    color: var(--text-dark);
}

/* =========================
   NAVBAR
========================= */
.navbar {
    position: fixed;
    inset: 0 0 auto 0;
    padding: 0.5rem 1rem;
    z-index: 1000;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: var(--primary-blue);
    color: var(--white);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease;
}

.back-link:hover {
    background: var(--dark-blue);
    transform: translateY(-2px);
}

/* =========================
   LAYOUT
========================= */
.register-wrapper {
    width: 100%;
    max-width: 500px;
    margin-top: 3.5rem;
}

/* =========================
   AUTH CARD
========================= */
.auth-container {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

/* =========================
   LOGO
========================= */
.logo-section {
    text-align: center;
    margin-bottom: 1.5rem;
}

.logo-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.logo-text {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary-blue);
}

/* =========================
   HEADINGS
========================= */
h1 {
    text-align: center;
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
}

.subtitle {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 1.25rem;
}

/* =========================
   FORM
========================= */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.7rem 0.85rem;
    font-size: 16px;
    border-radius: 6px;
    border: 2px solid var(--border-color);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* =========================
   PASSWORD
========================= */
.password-input-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.password-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.password-requirements {
    margin-top: 0.5rem;
    padding: 0.75rem;
    font-size: 0.75rem;
    background: #f3f4f6;
    border-left: 3px solid var(--primary-blue);
    border-radius: 6px;
}

.requirement {
    display: flex;
    align-items: center;
    margin: 0.3rem 0;
}

.requirement.met {
    color: var(--success-color);
}

/* =========================
   MESSAGES
========================= */
.message {
    display: none;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.message.show {
    display: flex;
    gap: 0.5rem;
}

.message.success {
    background: #d1fae5;
    color: #065f46;
}

.message.error {
    background: #fee2e2;
    color: #7f1d1d;
}

/* =========================
   BUTTONS
========================= */
.btn {
    width: 100%;
    padding: 0.7rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    margin-top: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: var(--white);
}

.btn-primary:hover {
    opacity: 0.95;
}

.btn-secondary {
    background: var(--white);
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
}

/* =========================
   FOOTER
========================= */
.auth-footer {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-light);
}

/* =========================
   LOADING
========================= */
.loading {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loading.show {
    display: flex;
}

.loading-content {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* =========================
   DESKTOP ENHANCEMENTS
========================= */
@media (min-width: 768px) {
    .register-wrapper {
        max-width: 1100px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .auth-container {
        padding: 2rem;
    }
}

    /* =========================
       CHECKBOX STYLING
    ========================= */
    .checkbox-group {
        margin: 1rem 0;
    }

    .checkbox-label {
        display: flex;
        align-items: flex-start;
        cursor: pointer;
        user-select: none;
    }

    .checkbox-label input[type="checkbox"] {
        width: 18px;
        height: 18px;
        margin-top: 2px;
        margin-right: 0.75rem;
        cursor: pointer;
        accent-color: var(--primary-blue);
        flex-shrink: 0;
    }

    .checkbox-text {
        font-size: 0.95rem;
        color: var(--text-dark);
        line-height: 1.5;
    }

    .checkbox-text a {
        color: var(--primary-blue);
        text-decoration: none;
        font-weight: 500;
        border-bottom: 1px solid transparent;
        transition: all 0.3s ease;
    }

    .checkbox-text a:hover {
        border-bottom-color: var(--primary-blue);
        text-decoration: underline;
    }

    .required-asterisk {
        color: var(--error-color);
        font-weight: bold;
        margin-left: 2px;
    }

    /* Validation error styling for checkbox */
    .checkbox-group .form-error {
        margin-top: 0.5rem;
        margin-left: 2.5rem;
    }
