/* ====================
   CSS Variables & Reset
   ==================== */
:root {
    --primary-color: #6C63FF;
    --primary-dark: #5A52D5;
    --primary-light: #8B83FF;
    --secondary-color: #2D3748;
    --text-primary: #1A202C;
    --text-secondary: #4A5568;
    --text-muted: #718096;
    --bg-primary: #F7FAFC;
    --bg-white: #FFFFFF;
    --bg-sidebar: #1A202C;
    --border-color: #E2E8F0;
    --success-color: #48BB78;
    --error-color: #FC8181;
    --warning-color: #F6AD55;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 10px 40px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.15);
    --radius: 16px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-image: radial-gradient(ellipse at top left, rgba(108, 99, 255, 0.06) 0%, transparent 50%),
                      radial-gradient(ellipse at bottom right, rgba(108, 99, 255, 0.04) 0%, transparent 50%);
}

/* ====================
   Auth Container
   ==================== */
.auth-container {
    display: flex;
    max-width: 1200px;
    width: 100%;
    min-height: 600px;
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* ====================
   Auth Card (Left Side)
   ==================== */
.auth-card {
    flex: 1;
    padding: 48px 40px;
    max-width: 560px;
    min-width: 400px;
    max-height: min(700px, 85vh);
    display: flex;
    flex-direction: column;
}

.auth-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.auth-panel[hidden] {
    display: none;
}

/* ====================
   HEADER STYLES (Including H2)
   ==================== */

/* H1 - Main Logo Title */
.auth-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0;
    margin: 0;
    line-height: 1.2;
}

/* H2 - Sidebar Headings */
.auth-sidebar h2 {
    font-size: 28px;
    font-weight: 700;
    color: white;
    letter-spacing: 0;
    line-height: 1.3;
    margin-bottom: 28px;
    position: relative;
    padding-bottom: 16px;
}
.auth-sidebar h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 4px;
}
/* Feature Item H4 */
.feature-item h4 {
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin: 0 0 4px 0;
    line-height: 1.3;
}
/* Subtitle H3 style */
.subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
    margin-left: 56px;
    font-weight: 400;
}


/* Header */
.auth-header {
    margin-bottom: 32px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
}

.auth-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0;
}

.subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
    margin-left: 56px;
}

/* ====================
   Auth Tabs
   ==================== */
.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
}

.auth-tab {
    flex: 1;
    padding: 12px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.auth-tab:hover {
    color: var(--text-primary);
}

.auth-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* ====================
   Alerts
   ==================== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.5;
    animation: slideDown 0.3s ease;
}

.alert i {
    margin-top: 2px;
    flex-shrink: 0;
}

.alert-error {
    background: #FFF5F5;
    color: #C53030;
    border-left: 4px solid var(--error-color);
}

.alert-success {
    background: #F0FFF4;
    color: #276749;
    border-left: 4px solid var(--success-color);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ====================
   Form Styles
   ==================== */
.auth-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group label i {
    color: var(--text-muted);
    font-size: 14px;
    width: 18px;
}

.required {
    color: var(--error-color);
    font-weight: 700;
}

.form-group input:not([type="checkbox"]) {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font-family);
    transition: var(--transition);
    background: var(--bg-white);
    color: var(--text-primary);
    width: 100%;
}

.form-group input:not([type="checkbox"]):focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.1);
}

.form-group input:not([type="checkbox"])::placeholder {
    color: #A0AEC0;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Password Wrapper */
.password-wrapper {
    position: relative;
    width: 100%;
}

.password-wrapper input {
    padding-right: 48px !important;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
    transition: var(--transition);
}

.toggle-password:hover {
    color: var(--text-primary);
}

/* Password Strength */
.password-strength {
    margin-top: 8px;
}

.strength-bar {
    height: 4px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.strength-level {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease, background 0.3s ease;
}

.strength-text {
    font-size: 12px;
    color: var(--text-muted);
    display: block;
    margin-top: 4px;
}

.password-match {
    font-size: 12px;
    margin-top: 4px;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    padding-left: 4px;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    display: inline-block;
    position: relative;
    flex-shrink: 0;
    transition: var(--transition);
    background: white;
}

.checkbox-label input:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label input:focus + .checkmark {
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.2);
}

.checkbox-label a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 4px 0;
}

.forgot-link {
    font-size: 13px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.forgot-link:hover {
    text-decoration: underline;
}

/* Buttons */
.btn-primary {
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 4px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 99, 255, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary i {
    font-size: 18px;
}

/* Social Auth */
.social-auth {
    margin-top: 12px;
}

.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 16px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    color: var(--text-muted);
    font-size: 13px;
    white-space: nowrap;
}

.social-buttons {
    display: flex;
    gap: 12px;
}

.social-btn {
    flex: 1;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.social-btn:hover {
    border-color: var(--primary-color);
    background: #F8F7FF;
}

.social-btn svg {
    flex-shrink: 0;
}

.social-btn.microsoft i {
    color: #00A4EF;
}

/* Auth Footer */
.auth-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-link:hover {
    text-decoration: underline;
}

/* System Status */
.system-status {
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

.status-divider {
    color: var(--border-color);
}

/* ====================
   Password Strength States
   ==================== */
.strength-level.weak {
    background: var(--error-color);
    width: 33%;
}

.strength-level.medium {
    background: var(--warning-color);
    width: 66%;
}

.strength-level.strong {
    background: var(--success-color);
    width: 100%;
}

.password-match.match {
    color: var(--success-color);
}

.password-match.no-match {
    color: var(--error-color);
}

/* ====================
   Feature Highlights Sidebar (Right Side)
   ==================== */
.auth-sidebar {
    flex: 1;
    background: var(--bg-sidebar);
    background-image: linear-gradient(135deg, var(--bg-sidebar) 0%, #2D3748 100%);
    padding: 48px 40px;
    display: flex;
    align-items: center;
    color: white;
}

.sidebar-content {
    width: 100%;
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.feature-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 12px;
    background: rgba(108, 99, 255, 0.2);
    color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.feature-text p {
    font-size: 13px;
    color: #A0AEC0;
    line-height: 1.5;
}

.sidebar-footer {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer p {
    font-size: 13px;
    color: #A0AEC0;
}

/* ====================
   Responsive
   ==================== */
@media (max-width: 992px) {
    .auth-sidebar {
        display: none;
    }

    .auth-card {
        max-width: 520px;
        /* The height cap + internal scroll exists only to keep the sidebar
           from towering empty next to a short login form. There's no sidebar
           here, so let the card grow naturally and the page scroll instead —
           a nested scroll region is awkward to use with touch. */
        max-height: none;
    }

    .auth-panel {
        flex: none;
        min-height: 0;
        overflow-y: visible;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0;
    }

    .auth-container {
        min-height: 100vh;
        border-radius: 0;
    }

    .auth-card {
        min-width: 0;
        padding: 32px 24px;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .social-buttons {
        flex-direction: column;
    }
}

/* Polish pass */
body {
    min-height: 100svh;
    background: #eef2f7;
    background-image: none;
    align-items: flex-start;
    padding: 40px 20px;
}

.auth-container {
    max-width: 1120px;
    min-height: 620px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 22px 70px rgba(15, 23, 42, 0.14);
}

.auth-card {
    padding: 44px;
    max-height: none;
}

.auth-panel {
    flex: none;
    min-height: auto;
    overflow: visible;
}

.auth-sidebar {
    background: #172033;
    background-image: none;
}

.logo-icon,
.feature-icon,
.alert,
.form-group input:not([type="checkbox"]),
.btn-primary {
    border-radius: 8px;
}

.auth-tab {
    border-radius: 8px 8px 0 0;
}

.form-options {
    justify-content: flex-start;
}

.btn-primary:hover {
    transform: none;
    box-shadow: 0 8px 22px rgba(108, 99, 255, 0.24);
}

@media (max-width: 992px) {
    .auth-container {
        max-width: 560px;
        min-height: auto;
    }
}

/* Premium redesign */
:root {
    --primary-color: #0f766e;
    --primary-dark: #115e59;
    --primary-light: #5eead4;
    --secondary-color: #18181b;
    --text-primary: #18181b;
    --text-secondary: #3f3f46;
    --text-muted: #71717a;
    --bg-primary: #f6f7f9;
    --bg-white: #ffffff;
    --bg-sidebar: #18181b;
    --border-color: #e4e4e7;
    --success-color: #16a34a;
    --error-color: #dc2626;
    --warning-color: #d97706;
    --shadow-sm: 0 1px 2px rgba(24, 24, 27, .04);
    --shadow-md: 0 18px 50px rgba(24, 24, 27, .08);
    --shadow-lg: 0 28px 90px rgba(24, 24, 27, .13);
    --radius: 8px;
    --radius-sm: 8px;
}

body {
    background: #f6f7f9;
    padding: 42px 22px;
}

.auth-container {
    max-width: 1160px;
    min-height: 680px;
    border: 1px solid rgba(212, 212, 216, .9);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
}

.auth-card {
    flex: 0 0 500px;
    max-width: 500px;
    min-width: 0;
    padding: 48px;
    background: #ffffff;
}

.auth-header {
    margin-bottom: 36px;
}

.logo-container {
    gap: 14px;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: #0f766e;
    box-shadow: 0 12px 28px rgba(15, 118, 110, .22);
}

.auth-header h1 {
    font-size: 24px;
    font-weight: 700;
}

.subtitle {
    margin-left: 56px;
    color: #71717a;
}

.auth-tabs {
    gap: 6px;
    padding: 4px;
    border: 1px solid #e4e4e7;
    border-radius: 8px;
    background: #fafafa;
    margin-bottom: 28px;
}

.auth-tab {
    border: 0;
    margin: 0;
    border-radius: 6px;
    padding: 10px 14px;
    color: #52525b;
}

.auth-tab.active {
    background: #18181b;
    color: #ffffff;
    border: 0;
    box-shadow: 0 8px 18px rgba(24, 24, 27, .14);
}

.auth-form {
    gap: 18px;
}

.form-group label {
    color: #3f3f46;
}

.form-group label i {
    color: #71717a;
}

.form-group input:not([type="checkbox"]) {
    min-height: 48px;
    border: 1px solid #d4d4d8;
    background: #ffffff;
    border-radius: 8px;
}

.form-group input:not([type="checkbox"]):focus {
    border-color: #0f766e;
    box-shadow: 0 0 0 4px rgba(15, 118, 110, .12);
}

.btn-primary {
    min-height: 50px;
    background: #18181b;
    border-radius: 8px;
    box-shadow: none;
}

.btn-primary:hover {
    background: #0f766e;
    box-shadow: 0 16px 34px rgba(15, 118, 110, .2);
}

.alert {
    border: 1px solid transparent;
    border-left-width: 4px;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
    border-left-color: #dc2626;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border-color: #bbf7d0;
    border-left-color: #16a34a;
}

.system-status {
    margin-top: auto;
    padding-top: 22px;
}

.auth-sidebar {
    flex: 1;
    align-items: stretch;
    padding: 56px;
    background: #18181b;
    color: #ffffff;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sidebar-content[hidden] {
    display: none;
}

.auth-eyebrow {
    color: #5eead4;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.auth-sidebar h2 {
    max-width: 430px;
    padding: 0;
    margin: 0 0 34px;
    font-size: 34px;
    line-height: 1.12;
    font-weight: 700;
}

.auth-sidebar h2::after {
    display: none;
}

.auth-preview {
    max-width: 460px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 8px;
    background: #222225;
    padding: 24px;
    box-shadow: 0 26px 70px rgba(0, 0, 0, .28);
}

.preview-topline,
.preview-row,
.preview-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.preview-topline {
    margin-bottom: 22px;
    color: #d4d4d8;
}

.preview-topline strong {
    color: #5eead4;
    font-size: 22px;
}

.preview-chart {
    height: 126px;
    display: flex;
    align-items: end;
    gap: 10px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 8px;
    background: #18181b;
}

.preview-chart span {
    flex: 1;
    min-width: 18px;
    border-radius: 5px 5px 0 0;
    background: #0f766e;
}

.preview-grid {
    margin: 18px 0;
}

.preview-grid div {
    flex: 1;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 8px;
    background: rgba(255, 255, 255, .03);
}

.preview-grid small,
.preview-row em {
    display: block;
    color: #a1a1aa;
    font-size: 11px;
    font-style: normal;
}

.preview-grid strong {
    display: block;
    margin-top: 5px;
    font-size: 18px;
}

.preview-row {
    padding: 12px 0;
    color: #e4e4e7;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.preview-row i {
    color: #5eead4;
    margin-right: 8px;
}

.preview-steps {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.preview-steps div {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 8px;
    background: #18181b;
    color: #e4e4e7;
}

.preview-steps i {
    color: #5eead4;
}

@media (max-width: 992px) {
    body {
        padding: 24px;
    }

    .auth-card {
        flex-basis: auto;
        max-width: none;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0;
    }

    .auth-card {
        padding: 30px 22px;
    }
}
