/* --- CSS VARIABLES --- */
:root {
    --color-dark-red: #8B252F;
    --color-coral: #F06A6A;
    --color-light-blue-bg: #EBF5F8;
    --color-turquoise: #43C5D1;
    --color-dark-teal: #1B576D;
    --color-medical-navy: #1B365D; /* Matches portal footer */
    --color-white: #FFFFFF;
    --color-text-primary: #1B576D;
    --color-text-secondary: #5a7a88;
    --color-border: #dbe4e7;
    --font-family-sans: 'Inter', sans-serif;
}

/* --- GLOBAL RESET & STYLES --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font-family-sans);
    background-color: var(--color-light-blue-bg);
    color: var(--color-text-primary);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

/* --- SITE HEADER & FOOTER --- */
/* Force white header on all pages */
header.site-header,
.site-header,
body > header.site-header,
body header.site-header {
    background-color: #FFFFFF !important;
    background: #FFFFFF !important;
    color: #1B576D !important;
    padding: 0 2rem !important;
    flex-shrink: 0;
    border-bottom: 1px solid #dbe4e7 !important;
}

/* Force dark navy footer on all pages */
footer.site-footer,
.site-footer,
body > footer.site-footer,
body footer.site-footer {
    background-color: #1B365D !important;
    background: #1B365D !important;
    color: #FFFFFF !important;
    padding: 1.5rem !important;
    text-align: center !important;
    font-size: 0.9rem !important;
    flex-shrink: 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    height: 80px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 600;
    font-size: 1.1rem;
    color: #1B576D; /* Match HOSA Command Portal text color */
}

.logo-container span {
    color: #1B576D !important; /* Ensure HOSA Command Portal text is visible */
}

.logo {
    max-width: 50px;
}

.site-nav,
nav.site-nav,
.site-header nav.site-nav,
.header-container nav.site-nav {
    display: flex;
    align-items: center;
}

.site-nav a,
nav.site-nav a,
.site-header nav.site-nav a,
.header-container nav.site-nav a,
.site-header .site-nav a {
    color: #1B576D !important; /* Match HOSA Command Portal text color for visibility */
    text-decoration: none !important;
    margin-left: 1.5rem;
    font-weight: 500 !important;
    font-size: 1rem !important;
    transition: color 0.2s;
    cursor: pointer;
    display: inline-block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.site-nav a:hover,
nav.site-nav a:hover,
.site-header nav.site-nav a:hover {
    color: var(--color-turquoise) !important;
}

.site-footer p {
    margin: 0.5rem 0;
}

.site-footer p:first-child {
    margin-top: 0;
}

.site-footer p:last-child {
    margin-bottom: 0;
}

/* --- MAIN CONTENT & AUTH CARD --- */
.main-content {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
}

.auth-card {
    background-color: var(--color-white);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 10px 25px rgba(27, 87, 109, 0.1);
    width: 100%;
    max-width: 420px;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--color-text-secondary);
}

/* --- FORM STYLES --- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-text-secondary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.form-group input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: var(--font-family-sans);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-turquoise);
    box-shadow: 0 0 0 3px rgba(67, 197, 209, 0.2);
}

/* --- PASSWORD FIELD ALIGNMENT FIX --- */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-right: 3rem; /* Make space for the icon */
}

.password-toggle-btn {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
}

.password-toggle-btn:hover {
    color: var(--color-text-primary);
}


/* --- FORM OPTIONS & REMEMBER ME ALIGNMENT FIX --- */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.remember-me input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin: 0;
}

.forgot-password {
    color: var(--color-turquoise);
    font-weight: 600;
    text-decoration: none;
}

.forgot-password:hover {
    text-decoration: underline;
}

/* --- BUTTONS --- */
.btn {
    width: 100%;
    padding: 0.9rem 1rem;
    border-radius: 8px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    text-align: center;
}

.btn-primary {
    background-color: var(--color-turquoise);
    color: var(--color-white);
}

.btn-primary:hover {
    background-color: #3ab1bd;
}

/* --- SEPARATOR --- */
.separator {
    text-align: center;
    color: var(--color-text-secondary);
    margin: 1.5rem 0;
    font-size: 0.875rem;
    position: relative;
}

.separator::before,
.separator::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background-color: var(--color-border);
}

.separator::before { left: 0; }
.separator::after { right: 0; }


/* --- AUTH FOOTER & TOGGLE LINK --- */
.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
}

.auth-footer p {
    color: var(--color-text-secondary);
}

.auth-footer a {
    color: var(--color-turquoise);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* --- UTILITY CLASSES --- */
.hidden {
    display: none;
}

/* Suggest Password Button */
#suggest-password-btn:hover {
    background: var(--color-turquoise) !important;
    color: white !important;
    border-color: var(--color-turquoise) !important;
}

.error-message {
    background-color: #fff0f0;
    color: var(--color-dark-red);
    border: 1px solid var(--color-coral);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    text-align: center;
}

.success-message {
    background-color: #f0fff4;
    color: #22543d;
    border: 1px solid #9ae6b4;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    text-align: center;
}

/* --- MODAL STYLES --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none !important;
}

.modal-content {
    background-color: var(--color-white);
    border-radius: 12px;
    padding: 2.5rem;
    max-width: 420px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    position: relative;
}

.modal-header {
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.modal-header p {
    color: var(--color-text-secondary);
}

.close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--color-text-primary);
}
