@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Instrument+Serif:ital@0;1&display=swap');

:root {
    --icays-navy: #063970;
    --icays-navy-deep: #021529;
    --icays-indigo: #210d5e;
    --icays-teal: #0e7490;
    --icays-teal-bright: #0891b2;
    --icays-slate: #0a1628;
    --icays-slate-light: #111f35;
    --icays-border: rgba(148, 163, 184, 0.14);
    --icays-border-focus: rgba(14, 116, 144, 0.65);
    --icays-text: #e2e8f0;
    --icays-text-muted: #94a3b8;
    --icays-text-dim: #64748b;
    --icays-danger: #fca5a5;
    --icays-danger-bg: rgba(127, 29, 29, 0.35);
    --icays-danger-border: rgba(248, 113, 113, 0.35);
    --login-radius: 14px;
    --login-shadow: 0 32px 64px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

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

::selection {
    color: #fff;
    background: var(--icays-teal);
}

html {
    height: 100%;
}

body.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--icays-text);
    background: var(--icays-navy-deep);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 60% at 15% 10%, rgba(33, 13, 94, 0.55) 0%, transparent 55%),
        radial-gradient(ellipse 70% 50% at 85% 90%, rgba(6, 57, 112, 0.7) 0%, transparent 50%),
        linear-gradient(155deg, #010812 0%, #021529 38%, #063970 100%);
}

.login-bg-grid {
    position: absolute;
    inset: 0;
    opacity: 0.35;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 90% 80% at 50% 45%, #000 20%, transparent 100%);
}

.login-bg-glow {
    position: absolute;
    width: 520px;
    height: 520px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -52%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(14, 116, 144, 0.12) 0%, transparent 68%);
    pointer-events: none;
    animation: login-glow-pulse 8s ease-in-out infinite;
}

@keyframes login-glow-pulse {
    0%, 100% { opacity: 0.55; transform: translate(-50%, -52%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -52%) scale(1.06); }
}

.login-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px 72px;
}

.login-card {
    width: 100%;
    max-width: 860px;
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    border-radius: calc(var(--login-radius) + 2px);
    overflow: hidden;
    box-shadow: var(--login-shadow);
    border: 1px solid var(--icays-border);
    animation: login-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes login-rise {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-brand {
    position: relative;
    padding: 36px 32px;
    background:
        linear-gradient(165deg, rgba(33, 13, 94, 0.92) 0%, rgba(6, 57, 112, 0.95) 55%, rgba(2, 21, 41, 0.98) 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 28px;
    overflow: hidden;
}

.login-brand::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -30%;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    border: 1px solid rgba(148, 163, 184, 0.08);
    pointer-events: none;
}

.login-brand::after {
    content: '';
    position: absolute;
    bottom: 24px;
    left: 32px;
    right: 32px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(14, 116, 144, 0.45), transparent);
}

.login-brand-top {
    position: relative;
    z-index: 1;
}

.login-brand-logo {
    width: min(200px, 100%);
    height: auto;
    margin-bottom: 22px;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.35));
}

.login-brand-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    margin-bottom: 16px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #cbd5e1;
    background: rgba(2, 21, 41, 0.55);
    border: 1px solid rgba(14, 116, 144, 0.35);
}

.login-brand-eyebrow svg {
    width: 13px;
    height: 13px;
    color: var(--icays-teal-bright);
}

.login-brand-title {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: clamp(1.65rem, 3vw, 2rem);
    font-weight: 400;
    line-height: 1.15;
    color: #f8fafc;
    margin-bottom: 10px;
}

.login-brand-subtitle {
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--icays-text-muted);
    max-width: 28ch;
}

.login-brand-metrics {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 10px;
}

.login-metric {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 10px;
    background: rgba(2, 21, 41, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.login-metric-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(14, 116, 144, 0.18);
    color: #67e8f9;
}

.login-metric-icon svg {
    width: 16px;
    height: 16px;
}

.login-metric strong {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 2px;
}

.login-metric span {
    font-size: 0.72rem;
    line-height: 1.4;
    color: var(--icays-text-dim);
}

.login-form-panel {
    padding: 32px 34px 28px;
    background: linear-gradient(180deg, var(--icays-slate-light) 0%, var(--icays-slate) 100%);
    display: flex;
    flex-direction: column;
}

.login-form-header {
    margin-bottom: 24px;
}

.login-form-header h1 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #f8fafc;
    margin-bottom: 6px;
}

.login-form-header p {
    font-size: 0.82rem;
    color: var(--icays-text-muted);
    line-height: 1.45;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.login-field label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--icays-text-dim);
}

.login-input-wrap {
    position: relative;
}

.login-input-wrap svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 17px;
    height: 17px;
    color: var(--icays-text-dim);
    pointer-events: none;
    transition: color 0.2s ease;
}

.login-input-wrap:focus-within svg {
    color: var(--icays-teal-bright);
}

.login-input-wrap input {
    width: 100%;
    height: 44px;
    padding: 0 14px 0 42px;
    border-radius: 10px;
    border: 1px solid var(--icays-border);
    background: rgba(2, 21, 41, 0.72);
    color: #f8fafc;
    font-family: inherit;
    font-size: 0.92rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.login-input-wrap input::placeholder {
    color: #475569;
}

.login-input-wrap input:hover {
    border-color: rgba(148, 163, 184, 0.22);
    background: rgba(2, 21, 41, 0.88);
}

.login-input-wrap input:focus {
    outline: none;
    border-color: var(--icays-border-focus);
    box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.18);
    background: rgba(2, 21, 41, 0.95);
}

.login-input-wrap input.error {
    border-color: rgba(248, 113, 113, 0.65);
    animation: login-shake 0.45s ease;
}

@keyframes login-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    50% { transform: translateX(4px); }
    75% { transform: translateX(-4px); }
}

.login-submit {
    margin-top: 4px;
    height: 46px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #f8fafc;
    background: linear-gradient(135deg, var(--icays-navy) 0%, var(--icays-indigo) 52%, #0c4a6e 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 10px 28px rgba(2, 21, 41, 0.55);
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.login-submit:hover {
    filter: brightness(1.08);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 14px 32px rgba(14, 116, 144, 0.25);
}

.login-submit:active {
    transform: translateY(1px);
}

.login-submit:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 3px rgba(14, 116, 144, 0.35),
        0 10px 28px rgba(2, 21, 41, 0.55);
}

.login-security-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--icays-border);
    font-size: 0.72rem;
    color: var(--icays-text-dim);
    line-height: 1.4;
}

.login-security-note svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    color: var(--icays-teal);
}

.login-messages {
    margin-top: 14px;
}

.login-alert {
    padding: 11px 13px;
    border-radius: 10px;
    font-size: 0.82rem;
    line-height: 1.45;
    border: 1px solid var(--icays-danger-border);
    background: var(--icays-danger-bg);
    color: var(--icays-danger);
}

.login-site-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 14px 16px;
    text-align: center;
    font-size: 0.72rem;
    line-height: 1.5;
    color: rgba(148, 163, 184, 0.75);
    background: linear-gradient(180deg, transparent, rgba(1, 8, 18, 0.85));
}

.login-site-footer strong {
    display: block;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.85);
}

.login-mobile-logo {
    display: none;
    width: 72px;
    height: auto;
    margin-bottom: 14px;
}

@media (max-width: 768px) {
    .login-shell {
        padding: 16px 12px 64px;
        align-items: flex-start;
        padding-top: max(16px, env(safe-area-inset-top));
    }

    .login-card {
        grid-template-columns: 1fr;
        max-width: 420px;
    }

    .login-brand {
        display: none;
    }

    .login-mobile-logo {
        display: block;
    }

    .login-form-panel {
        padding: 28px 22px 22px;
    }

    .login-form-header h1 {
        font-size: 1.2rem;
    }
}

@media (max-width: 380px) {
    .login-form-panel {
        padding: 24px 18px 20px;
    }

    .login-input-wrap input,
    .login-submit {
        height: 42px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-card,
    .login-bg-glow,
    .login-input-wrap input.error {
        animation: none;
    }

    .login-submit,
    .login-input-wrap input {
        transition: none;
    }
}
