:root {
    --surface-base: #F5F0E8;
    --surface-card: #FDFBF7;
    --surface-inset: #EDE4D3;
    --surface-hover: #F8F4ED;

    --ink-primary: #1A1814;
    --ink-secondary: #4A4540;
    --ink-tertiary: #8A837A;
    --ink-muted: #B5AFA7;

    --brand-deep: #011F3D;
    --brand-emerald: #01579B;
    --brand-emerald-hover: #014680;
    --brand-emerald-active: #013A6B;
    --brand-gold: #C8963E;
    --brand-gold-light: #D4A853;
    --brand-crest-dark: #0D4025;

    --divider: #E3DCD3;
    --divider-strong: #D4CFC6;
    --divider-hover: #C5BEB6;
    --divider-focus: var(--brand-emerald);

    --seal-error: #C0392B;
    --seal-error-bg: #FDF0ED;
    --seal-warning: #E67E22;
    --seal-warning-text: #B05D15;
    --seal-warning-bg: #FFF8EC;
    --seal-success: #1B8C42;

    --shadow-focus: 0 0 0 3px rgba(1,87,155,0.12);
    --shadow-btn-hover: 0 6px 20px rgba(1,87,155,0.30);
    --shadow-btn-active: 0 2px 8px rgba(1,87,155,0.22);

    --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body: 'DM Sans', -apple-system, 'Segoe UI', sans-serif;

    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --duration-fast: 0.2s;
    --duration-normal: 0.3s;
    --duration-slow: 0.6s;
    --duration-enter: 0.8s;

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-body);
    background: var(--surface-base);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.login-grid {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    min-height: 100vh;
}

.brand-panel {
    position: relative;
    overflow: hidden;
    background: linear-gradient(155deg, var(--brand-deep) 0%, var(--brand-emerald) 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 56px 60px;
    color: #fff;
}

.brand-panel .deco-circle-1 {
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
    top: -140px;
    right: -120px;
}

.brand-panel .deco-circle-2 {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    bottom: -110px;
    left: -80px;
}

.brand-panel .deco-circle-3 {
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(200,150,62,.10);
    top: 40%;
    left: 60%;
}

.brand-logo-wrap {
    display: flex;
    align-items: center;
    gap: 13px;
    position: relative;
}

.brand-logo-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: rgba(255,255,255,.18);
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-logo-icon i {
    color: var(--brand-gold);
    font-size: 22px;
}

.brand-logo-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 21px;
    letter-spacing: .5px;
}

.brand-content {
    position: relative;
}

.brand-content h1 {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 40px;
    line-height: 1.15;
    margin: 0 0 18px;
}

.brand-content p {
    font-size: 17px;
    line-height: 1.6;
    margin: 0;
    max-width: 430px;
    color: rgba(255,255,255,.88);
}

.brand-footer {
    position: relative;
    font-size: 14px;
    color: rgba(255,255,255,.75);
}

.form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.form-inner {
    width: 100%;
    max-width: 392px;
}

.form-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 30px;
    margin: 0 0 6px;
    color: var(--ink-primary);
}

.form-subtitle {
    margin: 0 0 28px;
    color: var(--ink-tertiary);
    font-size: 15px;
}

.field-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .7px;
    color: var(--ink-tertiary);
    margin-bottom: 8px;
    text-transform: uppercase;
    transition: color var(--duration-fast) var(--ease-in-out);
}

.field-label.is-active {
    color: var(--brand-emerald);
}

.field-wrap {
    position: relative;
    margin-bottom: 18px;
}

.field-input {
    width: 100%;
    padding: 14px 44px 14px 16px;
    border-radius: 14px;
    border: 1.5px solid var(--divider-strong);
    background: #fff;
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--ink-primary);
    outline: none;
    transition:
        border-color var(--duration-normal) var(--ease-in-out),
        box-shadow var(--duration-normal) var(--ease-in-out);
}

.field-input::placeholder {
    color: var(--ink-muted);
}

.field-input:hover {
    border-color: var(--divider-hover);
}

.field-input:focus {
    border-color: var(--divider-focus);
    box-shadow: var(--shadow-focus);
}

.field-input.is-error {
    border-color: var(--seal-error);
}

.field-input.is-error:focus {
    box-shadow: 0 0 0 3px rgba(192,57,43,0.12);
}

.field-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--divider-strong);
    font-size: 16px;
    pointer-events: none;
    transition: color var(--duration-normal) var(--ease-in-out);
}

.field-wrap:hover .field-icon {
    color: var(--divider-hover);
}

.field-input:focus ~ .field-icon {
    color: var(--brand-emerald);
}

.field-input.is-error ~ .field-icon {
    color: var(--seal-error);
}

.btn-auth {
    display: block;
    text-align: center;
    width: 100%;
    padding: 15px;
    border-radius: 15px;
    background: linear-gradient(180deg, var(--brand-emerald) 0%, var(--brand-deep) 100%);
    color: #fff;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 16px;
    letter-spacing: .04em;
    cursor: pointer;
    border: none;
    margin-top: 10px;
    box-shadow: 0 10px 22px -8px rgba(1,87,155,.5);
    position: relative;
    overflow: hidden;
    transition:
        transform var(--duration-fast) var(--ease-in-out),
        box-shadow var(--duration-normal) var(--ease-in-out);
}

.btn-auth:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-btn-hover);
}

.btn-auth:active {
    transform: translateY(0);
    box-shadow: var(--shadow-btn-active);
}

.btn-auth:focus-visible {
    outline: 2px solid var(--brand-gold);
    outline-offset: 2px;
}

.btn-auth.is-loading {
    pointer-events: none;
    color: transparent;
}

.btn-auth.is-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255,255,255,0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.alert {
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-5);
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
}

.alert i {
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-error {
    background: var(--seal-error-bg);
    border: 1px solid rgba(192,57,43,0.15);
    color: var(--seal-error);
}

.alert-warning {
    background: var(--seal-warning-bg);
    border: 1px solid rgba(230,126,34,0.15);
    color: var(--seal-warning-text);
}

.alert-centered {
    justify-content: center;
    text-align: center;
}

.alert p {
    margin: var(--space-1) 0;
}

.alert p:first-child {
    margin-top: 0;
}

.blocked-notice {
    text-align: center;
    padding: var(--space-5);
}

.blocked-notice-icon {
    font-size: 24px;
    color: var(--seal-error);
    margin-bottom: var(--space-2);
    display: block;
}

.blocked-notice p {
    font-size: 13px;
    color: var(--ink-secondary);
    line-height: 1.6;
}

.form-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: var(--ink-muted);
}

@media (max-width: 768px) {
    .login-grid {
        grid-template-columns: 1fr;
    }

    .brand-panel {
        padding: 32px 28px;
        min-height: auto;
    }

    .brand-content h1 {
        font-size: 28px;
    }

    .brand-content p {
        font-size: 15px;
    }

    .form-panel {
        padding: 32px 28px;
    }
}

@media (max-width: 480px) {
    .brand-panel {
        padding: 24px 20px;
    }

    .brand-panel .deco-circle-1 {
        width: 200px;
        height: 200px;
        top: -80px;
        right: -60px;
    }

    .brand-panel .deco-circle-2 {
        width: 150px;
        height: 150px;
        bottom: -60px;
        left: -40px;
    }

    .brand-content h1 {
        font-size: 24px;
    }

    .form-panel {
        padding: 24px 20px;
    }

    .form-title {
        font-size: 24px;
    }
}
