:root {
    --brand-primary: #AB1410;
    --brand-secondary: #8a100d;
    --brand-dark: #6d0c0a;
    --brand-light: #c91812;
    --neutral-primary: #76777B;
    --neutral-secondary: #5e5f63;
    --neutral-light: #9a9b9e;
    --agent-primary: #AB1410;
    --agent-secondary: #8a100d;
    --agent-accent: #c91812;
    --supervisor-primary: #76777B;
    --supervisor-secondary: #5e5f63;
    --supervisor-accent: #9a9b9e;
    --text-dark: #0f1419;
    --text-light: #ffffff;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

/* Header Styles */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(171, 20, 16, 0.1);
    padding: 1rem 2rem;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.app-logo {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(171, 20, 16, 0.2);
}

.app-name {
    font-family: 'Crimson Pro', serif;
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.app-tagline {
    font-size: 0.75rem;
    color: var(--neutral-primary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: auto;
    display: none;
}

body {
    font-family: 'Manrope', sans-serif;
    min-height: 100vh;
    display: flex;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    overflow-x: hidden;
}

.container {
    display: flex;
    width: 100%;
    min-height: 100vh;
    position: relative;
}

/* Split screen panels */
.panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
    transition: flex 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.03;
    pointer-events: none;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 2px, currentColor 2px, currentColor 4px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, currentColor 2px, currentColor 4px);
}

.panel-agent {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    color: var(--text-light);
}

.panel-supervisor {
    background: linear-gradient(135deg, var(--neutral-primary) 0%, var(--neutral-secondary) 100%);
    color: var(--text-light);
}

/* Hover effects */
.panel:hover {
    flex: 1.1;
}

.panel:not(:hover) {
    flex: 0.9;
}

/* Login cards */
.login-card {
    background: var(--text-light);
    border-radius: 20px;
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.panel-agent .login-card {
    animation-delay: 0.2s;
}

.panel-supervisor .login-card {
    animation-delay: 0.3s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Role badge */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.panel-agent .role-badge {
    background: rgba(171, 20, 16, 0.15);
    color: var(--brand-dark);
}

.panel-supervisor .role-badge {
    background: rgba(118, 119, 123, 0.15);
    color: var(--neutral-secondary);
}

.role-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Typography */
.login-title {
    font-family: 'Crimson Pro', serif;
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Form elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Manrope', sans-serif;
    transition: all 0.3s ease;
    background: white;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Prevent zoom on iOS when focusing inputs */
@media screen and (max-width: 640px) {
    .form-input {
        font-size: 16px;
    }
}

.form-input:focus {
    outline: none;
    border-color: var(--input-focus-color);
    box-shadow: 0 0 0 4px var(--input-focus-shadow);
}

.panel-agent .form-input:focus {
    --input-focus-color: var(--brand-light);
    --input-focus-shadow: rgba(171, 20, 16, 0.1);
}

.panel-supervisor .form-input:focus {
    --input-focus-color: var(--neutral-light);
    --input-focus-shadow: rgba(118, 119, 123, 0.1);
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.checkbox-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--brand-primary);
}

.panel-supervisor .checkbox-input {
    accent-color: var(--neutral-primary);
}

.checkbox-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

/* Login button */
.btn-login {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Manrope', sans-serif;
    position: relative;
    overflow: hidden;
}

.panel-agent .btn-login {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
}

.panel-supervisor .btn-login {
    background: linear-gradient(135deg, var(--neutral-primary), var(--neutral-secondary));
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-login:active {
    transform: translateY(0);
}

/* Forgot password */
.forgot-password {
    text-align: center;
    margin-top: 1.5rem;
}

.forgot-password a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.panel-agent .forgot-password a:hover {
    color: var(--brand-primary);
}

.panel-supervisor .forgot-password a:hover {
    color: var(--neutral-primary);
}

/* Decorative elements */
.decorative-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.circle-1 {
    width: 300px;
    height: 300px;
    top: -100px;
    right: -100px;
    animation: float 20s infinite ease-in-out;
}

.circle-2 {
    width: 200px;
    height: 200px;
    bottom: -50px;
    left: -50px;
    animation: float 15s infinite ease-in-out reverse;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

/* Responsive */
@media (min-width: 968px) {
    .app-tagline {
        display: block;
    }
}

@media (max-width: 968px) {
    .container {
        flex-direction: column;
    }

    .panel {
        min-height: 50vh;
        padding: 2rem 1.5rem;
    }

    .panel:hover,
    .panel:not(:hover) {
        flex: 1;
    }

    .login-card {
        max-width: 100%;
        padding: 2rem 1.5rem;
    }

    .login-title {
        font-size: 1.75rem;
    }

    .decorative-circle {
        opacity: 0.5;
    }

    .circle-1 {
        width: 200px;
        height: 200px;
    }

    .circle-2 {
        width: 150px;
        height: 150px;
    }
}

@media (max-width: 640px) {
    body {
        background: #f8f9fa;
        padding-top: 64px;
    }

    .app-header {
        padding: 0.875rem 1rem;
    }

    .app-logo {
        width: 36px;
        height: 36px;
        font-size: 1.125rem;
        border-radius: 8px;
    }

    .app-name {
        font-size: 1.25rem;
    }

    .container {
        display: block;
    }

    .panel {
        min-height: auto;
        padding: 1.5rem 1rem;
        background: transparent !important;
    }

    .panel::before {
        display: none;
    }

    .decorative-circle {
        display: none;
    }

    .login-card {
        padding: 1.75rem 1.25rem;
        border-radius: 16px;
        box-shadow: var(--shadow-md);
        margin-bottom: 1rem;
    }

    .role-badge {
        padding: 0.4rem 0.875rem;
        font-size: 0.8125rem;
        margin-bottom: 1.25rem;
    }

    .role-icon {
        width: 18px;
        height: 18px;
    }

    .login-title {
        font-size: 1.5rem;
        margin-bottom: 0.4rem;
    }

    .login-subtitle {
        font-size: 0.875rem;
        margin-bottom: 1.5rem;
    }

    .form-group {
        margin-bottom: 1.25rem;
    }

    .form-label {
        font-size: 0.8125rem;
        margin-bottom: 0.4rem;
    }

    .form-input {
        padding: 0.75rem 0.875rem;
        font-size: 0.9375rem;
        border-radius: 8px;
    }

    .checkbox-group {
        margin-bottom: 1.25rem;
    }

    .checkbox-label {
        font-size: 0.8125rem;
    }

    .btn-login {
        padding: 0.875rem;
        font-size: 0.9375rem;
        border-radius: 8px;
    }

    .forgot-password {
        margin-top: 1.25rem;
    }

    .forgot-password a {
        font-size: 0.8125rem;
    }

    /* Add visual separation between panels on mobile */
    .panel-agent {
        background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
        padding-top: 2rem;
        padding-bottom: 1rem;
    }

    .panel-supervisor {
        background: linear-gradient(135deg, var(--neutral-primary) 0%, var(--neutral-secondary) 100%);
        padding-top: 1rem;
        padding-bottom: 2rem;
    }
}

@media (max-width: 380px) {
    body {
        padding-top: 60px;
    }

    .app-header {
        padding: 0.75rem 0.75rem;
    }

    .app-logo {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .app-name {
        font-size: 1.125rem;
    }

    .panel {
        padding: 1.25rem 0.75rem;
    }

    .login-card {
        padding: 1.5rem 1rem;
        border-radius: 12px;
    }

    .login-title {
        font-size: 1.375rem;
    }

    .form-input {
        padding: 0.7rem 0.75rem;
        font-size: 0.875rem;
    }

    .btn-login {
        padding: 0.8rem;
        font-size: 0.875rem;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 968px) and (orientation: landscape) {
    .panel {
        min-height: auto;
        padding: 1.5rem;
    }

    .login-card {
        padding: 1.5rem;
    }

    .login-title {
        font-size: 1.5rem;
    }

    .login-subtitle {
        margin-bottom: 1.25rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }
}

/* Loading state */
.btn-login.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-login.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}