/* Premium Medical AI Authentication - Dark Blue Theme */

/* Color System */
:root {
    --dark-blue-bg: #001a33;
    --dark-blue-card: #002b4d;
    --blue-accent: #0066cc;
    --cyan-accent: #00d4ff;
    --text-white: #FFFFFF;
    --text-gray: #a8b2c1;
    --input-bg: #003559;
    --input-border: #004d7a;
}

/* Base Layout - Dark Navy Background */
body.auth-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Helvetica Neue', sans-serif;
    background: linear-gradient(180deg, #001529 0%, #001a33 50%, #000d1a 100%);
    position: relative;
    overflow-x: hidden;
}

/* Converging Audio Waveform Background - High Amplitude Center Peak */
body.auth-body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='1920' height='1080' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='xMidYMid slice'%3E%3Cdefs%3E%3ClinearGradient id='waveGrad' x1='0%25' y1='50%25' x2='100%25' y2='50%25'%3E%3Cstop offset='0%25' style='stop-color:%230066cc;stop-opacity:0.15' /%3E%3Cstop offset='50%25' style='stop-color:%2300d4ff;stop-opacity:0.25' /%3E%3Cstop offset='100%25' style='stop-color:%230066cc;stop-opacity:0.15' /%3E%3C/linearGradient%3E%3C/defs%3E%3Cg stroke='url(%23waveGrad)' fill='none' stroke-linecap='round'%3E%3C!-- Main high amplitude wave --%3E%3Cpath d='M 0,540 L 300,540 L 400,380 L 480,540 L 560,200 L 640,540 L 720,380 L 800,540 L 900,540 L 960,470 L 1020,540 L 1080,470 L 1140,540 L 1200,540 L 1300,540 L 1400,540 L 1500,540 L 1600,540 L 1700,540 L 1800,540 L 1920,540' stroke-width='2.5' opacity='0.3'/%3E%3C!-- Sub detail waves --%3E%3Cpath d='M 0,540 L 280,540 L 380,400 L 460,540 L 540,240 L 620,540 L 700,400 L 780,540 L 880,540 L 940,490 L 1000,540 L 1060,490 L 1120,540 L 1180,540 L 1280,540 L 1380,540 L 1480,540 L 1580,540 L 1680,540 L 1780,540 L 1920,540' stroke-width='1.8' opacity='0.25'/%3E%3Cpath d='M 0,540 L 320,540 L 420,360 L 500,540 L 580,180 L 660,540 L 740,360 L 820,540 L 920,540 L 980,450 L 1040,540 L 1100,450 L 1160,540 L 1220,540 L 1320,540 L 1420,540 L 1520,540 L 1620,540 L 1720,540 L 1820,540 L 1920,540' stroke-width='2.2' opacity='0.28'/%3E%3Cpath d='M 0,540 L 310,540 L 410,420 L 490,540 L 570,280 L 650,540 L 730,420 L 810,540 L 910,540 L 970,510 L 1030,540 L 1090,510 L 1150,540 L 1210,540 L 1310,540 L 1410,540 L 1510,540 L 1610,540 L 1710,540 L 1810,540 L 1920,540' stroke-width='1.5' opacity='0.22'/%3E%3Cpath d='M 0,540 L 290,540 L 390,440 L 470,540 L 550,320 L 630,540 L 710,440 L 790,540 L 890,540 L 950,520 L 1010,540 L 1070,520 L 1130,540 L 1190,540 L 1290,540 L 1390,540 L 1490,540 L 1590,540 L 1690,540 L 1790,540 L 1920,540' stroke-width='1.3' opacity='0.18'/%3E%3Cpath d='M 0,540 L 330,540 L 430,340 L 510,540 L 590,160 L 670,540 L 750,340 L 830,540 L 930,540 L 990,430 L 1050,540 L 1110,430 L 1170,540 L 1230,540 L 1330,540 L 1430,540 L 1530,540 L 1630,540 L 1730,540 L 1830,540 L 1920,540' stroke-width='2' opacity='0.26'/%3E%3Cpath d='M 0,540 L 305,540 L 405,460 L 485,540 L 565,350 L 645,540 L 725,460 L 805,540 L 905,540 L 965,530 L 1025,540 L 1085,530 L 1145,540 L 1205,540 L 1305,540 L 1405,540 L 1505,540 L 1605,540 L 1705,540 L 1805,540 L 1920,540' stroke-width='1.2' opacity='0.16'/%3E%3Cpath d='M 0,540 L 295,540 L 395,480 L 475,540 L 555,390 L 635,540 L 715,480 L 795,540 L 895,540 L 955,535 L 1015,540 L 1075,535 L 1135,540 L 1195,540 L 1295,540 L 1395,540 L 1495,540 L 1595,540 L 1695,540 L 1795,540 L 1920,540' stroke-width='1' opacity='0.14'/%3E%3C/g%3E%3C/svg%3E");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 0;
    opacity: 0.9;
    animation: waveSlide 20s linear infinite;
}

@keyframes waveSlide {
    0% { transform: translateX(0); }
    100% { transform: translateX(-5%); }
}

/* Auth Wrapper */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    z-index: 1;
}

/* White Auth Card on Dark Background */
.auth-card {
    width: 100%;
    max-width: 460px;
    background: #FFFFFF;
    border: 1px solid rgba(0, 102, 204, 0.2);
    border-radius: 16px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(0, 102, 204, 0.3);
    overflow: hidden;
    position: relative;
    z-index: 2;
}

/* Branding Header */
.auth-brand-header {
    padding: 2.5rem 2.5rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
}

.auth-brand-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.875rem;
    margin-bottom: 0.75rem;
}

.auth-logo {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
}

.auth-brand-name {
    font-size: 2rem;
    font-weight: 700;
    color: #001a33;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin: 0;
    line-height: 1;
}

.auth-subtitle {
    font-size: 0.9375rem;
    color: #6b7280;
    font-weight: 400;
    margin: 0;
    letter-spacing: 0.01em;
}

/* Card Body */
.auth-card-body {
    padding: 2.5rem;
}

/* Form Groups */
.auth-form-group {
    margin-bottom: 1.5rem;
}

.auth-form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
    letter-spacing: 0.01em;
}

/* Input Fields - Light Theme */
.auth-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
    font-family: inherit;
    color: #111827;
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    transition: all 0.3s ease;
    outline: none;
}

.auth-input::placeholder {
    color: #9ca3af;
}

.auth-input:focus {
    border-color: #0066cc;
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* Password Container */
.auth-password-container {
    position: relative;
}

.auth-password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.125rem;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-password-toggle:hover {
    color: #0066cc;
}

/* HIPAA Consent Box - Dark Background */
.auth-consent-box {
    margin-bottom: 1.5rem;
    padding: 1.125rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.auth-consent-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
}

/* Functional Checkbox - Visible and Clickable */
.auth-checkbox {
    width: 20px;
    height: 20px;
    min-width: 20px;
    margin-top: 0.125rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: rgba(255, 255, 255, 0.9);
    border: 2px solid #0066cc;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.auth-checkbox:hover {
    border-color: #00d4ff;
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
}

.auth-checkbox:checked {
    background-color: #0066cc;
    border-color: #0066cc;
}

.auth-checkbox:checked::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid #FFFFFF;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.auth-checkbox:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.3);
}

.auth-checkbox:focus-visible {
    outline: 2px solid #00d4ff;
    outline-offset: 2px;
}

.auth-consent-label {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #4b5563;
    flex: 1;
}

/* Professional Medical Links - Underlined */
.auth-consent-label a,
.auth-link {
    color: #0066cc;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.auth-consent-label a:hover,
.auth-link:hover {
    color: #004d99;
    text-decoration-thickness: 1.5px;
}

.auth-link-center {
    text-align: center;
    margin: 1.5rem 0;
}

.auth-link {
    font-size: 0.9375rem;
    display: inline-block;
}

/* Primary Button - SIGN IN */
.auth-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    color: #FFFFFF;
    background: linear-gradient(135deg, #0066cc 0%, #004d99 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.auth-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.auth-btn:hover:not(:disabled)::before {
    left: 100%;
}

.auth-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #0080ff 0%, #0066cc 100%);
    box-shadow: 
        0 0 20px rgba(0, 212, 255, 0.5),
        0 6px 16px rgba(0, 0, 0, 0.4);
    transform: translateY(-1px);
}

.auth-btn:active:not(:disabled) {
    transform: translateY(0);
}

.auth-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.3);
}

.auth-btn:disabled {
    background: rgba(0, 102, 204, 0.3);
    cursor: not-allowed;
    color: rgba(255, 255, 255, 0.4);
    box-shadow: none;
}

.auth-btn-icon {
    font-size: 1rem;
}

/* Secondary Button Links */
.auth-btn-link {
    background: none;
    border: none;
    color: var(--cyan-accent);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.5rem;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

.auth-btn-link:hover {
    color: var(--blue-glow);
}

.auth-btn-group {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* 2FA / OTP Section */
.auth-section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #001a33;
    text-align: center;
    margin-bottom: 0.75rem;
    letter-spacing: 0.02em;
}

.auth-section-description {
    font-size: 0.9375rem;
    color: #6b7280;
    text-align: center;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.auth-highlight {
    color: #0066cc;
    font-weight: 600;
}

.auth-otp-input {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: 0.5em;
    text-align: center;
    padding: 1.125rem;
}

/* Utility */
.d-none {
    display: none !important;
}

/* HIPAA Modal - Dark Theme */
.hipaa-modal-content {
    background: linear-gradient(180deg, #00213d 0%, #001a33 100%);
    border: 1px solid rgba(0, 102, 204, 0.4);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
}

.hipaa-close-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    font-size: 1.5rem;
    color: #A9B4C6;
    cursor: pointer;
    padding: 0.25rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    z-index: 10;
}

.hipaa-close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
}

.hipaa-modal-body {
    padding: 2.5rem;
    color: #A9B4C6;
}

.hipaa-modal-body h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 1.5rem;
}

.hipaa-modal-body h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #FFFFFF;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.hipaa-modal-body p,
.hipaa-modal-body li {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: #A9B4C6;
}

.hipaa-modal-body strong {
    color: #FFFFFF;
}

.hipaa-modal-footer {
    padding: 1.5rem 2.5rem;
    border-top: 1px solid rgba(0, 102, 204, 0.3);
    display: flex;
    justify-content: center;
}

.hipaa-modal-footer .auth-btn {
    background: linear-gradient(135deg, #0066cc 0%, #004d99 100%);
    border: none;
    padding: 0.875rem 2.5rem;
    font-weight: 600;
    border-radius: 8px;
    color: #FFFFFF;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.hipaa-modal-footer .auth-btn:hover {
    background: linear-gradient(135deg, #0080ff 0%, #0066cc 100%);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

/* Responsive Design */
@media (max-width: 576px) {
    .auth-wrapper {
        padding: 1rem;
    }
    
    .auth-card {
        max-width: 100%;
        border-radius: 16px;
    }
    
    .auth-brand-header {
        padding: 2rem 1.5rem 1rem;
    }
    
    .auth-card-body {
        padding: 1.5rem;
    }
    
    .auth-brand-name {
        font-size: 1.625rem;
    }
    
    .auth-logo {
        width: 36px;
        height: 36px;
    }
}

/* Accessibility */
.auth-input:focus-visible,
.auth-checkbox:focus-visible,
.auth-btn:focus-visible {
    outline: 2px solid var(--blue-glow);
    outline-offset: 2px;
}

/* Loading State */
.auth-btn.loading {
    position: relative;
    color: transparent;
}

.auth-btn.loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin-left: -9px;
    margin-top: -9px;
    border: 2px solid var(--text-primary);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

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

/* Footer Links - Bottom Right Corner */
.auth-footer-links {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    gap: 1.5rem;
    z-index: 10;
}

.auth-footer-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.auth-footer-link:hover {
    color: #FFFFFF;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .auth-footer-links {
        bottom: 1rem;
        right: 1rem;
        gap: 1rem;
    }
    
    .auth-footer-link {
        font-size: 0.8125rem;
    }
}
