/* ==========================================================================
   Cepha Biomedical Premium Authentication Core Engine
   ========================================================================== */

:root {
    --bg-main: #f8fafc;
    --white: #ffffff;
    --slate-900: #0f172a;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-400: #94a3b8;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    
    /* Harmonized Medical Brand Architecture */
    --primary: #007A87;
    --primary-hover: #005A64;
    --primary-light: #e6f2f3;
    --accent: #00A3B4;
    
    --error-red: #ef4444;
    --error-bg: #fef2f2;
    --radius-xl: 20px;
    --radius-lg: 12px;
    --font-stack: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --shadow-premium: 0 20px 40px -15px rgba(15, 23, 42, 0.06), 0 1px 3px 0 rgba(15, 23, 42, 0.02);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-stack);
}

body {
    background-color: var(--bg-main);
    color: var(--slate-900);
    -webkit-font-smoothing: antialiased;
}

/* Page Frame Layout Wrapper */
.auth-page-wrapper {
    min-height: calc(100vh - 72px); /* Handles offsetting native system menu heights cleanly */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    background: radial-gradient(100% 100% at top left, rgba(0, 122, 135, 0.03) 0%, rgba(248, 250, 252, 0) 100%), var(--bg-main);
}

/* Auth Card Container */
.auth-container {
    width: 100%;
    max-width: 520px;
    background: var(--white);
    padding: 48px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--slate-200);
    box-shadow: var(--shadow-premium);
    position: relative;
    overflow: hidden;
}

/* Brand Identity Layout */
.auth-brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--slate-900);
    letter-spacing: -0.5px;
    margin-bottom: 28px;
}

.auth-brand-logo span {
    color: var(--primary);
    font-weight: 500;
}

.auth-header {
    text-align: center;
    margin-bottom: 36px;
}

.auth-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--slate-900);
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.auth-header p {
    color: var(--slate-600);
    font-size: 0.95rem;
    font-weight: 500;
}

/* Elegant Component Timeline Stepper */
.auth-stepper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin-bottom: 40px;
    padding: 0 4px;
}

.auth-stepper::before {
    content: '';
    position: absolute;
    top: 18px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--slate-100);
    z-index: 1;
}

.step-indicator {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: var(--white);
    padding: 0 12px;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--white);
    border: 2px solid var(--slate-200);
    color: var(--slate-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.88rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--slate-500);
    transition: color 0.3s ease;
}

.step-indicator.active .step-number {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 0 0 5px var(--primary-light);
}

.step-indicator.active .step-label {
    color: var(--slate-900);
    font-weight: 700;
}

/* Modern Form Structures & Fields */
.form-group {
    margin-bottom: 24px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--slate-800);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    font-size: 0.95rem;
    color: var(--slate-900);
    background-color: var(--white);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control::placeholder {
    color: var(--slate-400);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

/* Adaptive Split Component Grid Layouts */
.input-grid.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Step Panel Configurations */
.step-panel {
    display: none;
}

.step-panel.active {
    display: block !important;
}

/* Clean Form Document Dropzone */
.file-upload-dropzone {
    border: 2px dashed var(--slate-200);
    border-radius: var(--radius-lg);
    padding: 32px 20px;
    text-align: center;
    background: var(--bg-main);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.file-upload-dropzone:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

/* Buttons Architecture */
.btn-auth-action {
    width: 100%;
    padding: 14px 24px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 28px;
    transition: background 0.2s ease, transform 0.1s ease;
}

.btn-auth-action:hover {
    background: var(--primary-hover);
}

.btn-auth-action:active {
    transform: scale(0.995);
}

.btn-auth-action svg {
    transition: transform 0.2s ease;
}

.btn-auth-action:hover svg {
    transform: translateX(3px);
}

.btn-auth-secondary {
    width: 100%;
    padding: 12px 24px;
    background: transparent;
    color: var(--slate-600);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 12px;
    transition: all 0.2s ease;
}

.btn-auth-secondary:hover {
    background: var(--slate-100);
    color: var(--slate-900);
    border-color: var(--slate-300);
}

/* System Alerts Frame */
.auth-alert {
    background: var(--error-bg);
    border: 1px solid #fecaca;
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    color: var(--error-red);
    font-size: 0.88rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
    line-height: 1.4;
}

.auth-alert svg {
    flex-shrink: 0;
}

/* Form Action Footers */
.auth-footer-text {
    text-align: center;
    margin-top: 32px;
    font-size: 0.9rem;
    color: var(--slate-600);
}

.auth-footer-text a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    margin-left: 2px;
}

.auth-footer-text a:hover {
    text-decoration: underline;
}

/* Progress Submissions Pipeline Overlay */
.upload-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.upload-overlay.active {
    opacity: 1; pointer-events: auto;
}

.upload-card {
    background: var(--white);
    padding: 40px 32px;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 440px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    text-align: center;
    border: 1px solid var(--slate-100);
}

.upload-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--slate-900);
    margin-bottom: 8px;
}

.upload-subtitle {
    font-size: 0.9rem;
    color: var(--slate-600);
    margin-bottom: 24px;
    line-height: 1.5;
}

.progress-track {
    width: 100%; height: 8px; background: var(--slate-100);
    border-radius: 999px; overflow: hidden; margin-bottom: 12px;
}

.progress-fill {
    width: 0%; height: 100%;
    background: var(--primary);
    border-radius: 999px;
    transition: width 0.2s ease;
}

.progress-percentage {
    font-size: 0.95rem; font-weight: 800; color: var(--primary);
}

/* ==========================================================================
   Mobile Accessibility & Layout Breakpoints
   ========================================================================== */

@media (max-width: 640px) {
    .auth-page-wrapper {
        padding: 24px 16px;
    }

    .auth-container {
        padding: 32px 24px;
        border-radius: var(--radius-lg);
        box-shadow: none;
        border: none;
    }

    .auth-header {
        margin-bottom: 28px;
    }

    .auth-header h1 {
        font-size: 1.5rem;
    }

    .input-grid.split {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .auth-stepper {
        margin-bottom: 32px;
    }

    .step-number {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    .step-label {
        font-size: 0.75rem;
        display: none; /* Auto-clean label structures for tiny layouts */
    }
    
    .step-indicator {
        padding: 0 20px;
    }

    /* Blocks native text area zoom anomalies on iOS mobile viewports */
    .form-control {
        padding: 14px;
        font-size: 16px; 
    }
    
    .btn-auth-action {
        padding: 16px;
        font-size: 1rem;
    }
}