/* ============================================================
   Admin Login — Oxide Gate v2 (world-class demo UI)
   Presentation only. Loaded by application/views/admin/login.php
   ============================================================ */
@import url("https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=Instrument+Serif:ital@0;1&display=swap");

:root {
    --ink: #09090B;
    --ink-soft: #18181B;
    --oxide: #E11D48;
    --oxide-md: #F43F5E;
    --mist: #71717A;
    --line: #E4E4E7;
    --canvas: #F4F4F5;
    --surface: #FFFFFF;
    --shadow: 0 28px 80px rgba(9, 9, 11, 0.22);
    --radius: 20px;
}

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

html, body {
    min-height: 100%;
}

body.login-oxide {
    font-family: "DM Sans", system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    background:
        radial-gradient(900px 480px at 0% 0%, rgba(225, 29, 72, 0.14), transparent 55%),
        radial-gradient(700px 420px at 100% 100%, rgba(9, 9, 11, 0.1), transparent 50%),
        linear-gradient(165deg, #FAFAFA 0%, #F4F4F5 40%, #E4E4E7 100%);
}

/* Slim demo banners — don’t fight the composition */
body.login-oxide > .alert[data-testid] {
    width: 100%;
    flex-shrink: 0;
    margin: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    padding: 10px 16px !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em;
    z-index: 20;
}
body.login-oxide > .alert-warning[data-testid] {
    background: #18181B !important;
    color: #FAFAFA !important;
}
body.login-oxide > .alert-info[data-testid] {
    background: #FFF1F2 !important;
    color: #9F1239 !important;
}

.login-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right))
             max(28px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}

.login-shell {
    width: 100%;
    max-width: 980px;
    animation: loginRise 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes loginRise {
    from { opacity: 0; transform: translateY(22px) scale(0.985); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .login-shell,
    .login-left .welcome-text,
    .login-right { animation: none !important; }
    .btn-login { transition: none !important; }
}

.login-container {
    display: grid;
    grid-template-columns: minmax(280px, 0.95fr) 1.15fr;
    width: 100%;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid rgba(9, 9, 11, 0.06);
    min-height: 560px;
}

/* ---- Brand panel ---- */
.login-left {
    position: relative;
    padding: 44px 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #FAFAFA;
    overflow: hidden;
    background:
        radial-gradient(520px 280px at 100% 0%, rgba(244, 63, 94, 0.32), transparent 58%),
        radial-gradient(380px 240px at 0% 100%, rgba(255, 255, 255, 0.06), transparent 50%),
        linear-gradient(155deg, #09090B 0%, #141416 52%, #2A2A2E 100%);
}

.login-left::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #FECDD3 0%, #F43F5E 40%, #E11D48 100%);
    z-index: 2;
}

.login-left::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 20%, transparent 75%);
    pointer-events: none;
    opacity: 0.55;
}

/* Decorative medical equipment in the rose glow */
.login-med-art {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.login-med-art svg {
    position: absolute;
    color: #FB7185;
    opacity: 0.28;
    filter: drop-shadow(0 8px 24px rgba(225, 29, 72, 0.25));
}

.login-med-art .med-stethoscope {
    width: 168px;
    height: auto;
    top: 18%;
    right: -18px;
    opacity: 0.34;
    transform: rotate(-12deg);
}

.login-med-art .med-cross {
    width: 72px;
    height: auto;
    top: 8%;
    right: 28%;
    opacity: 0.22;
}

.login-med-art .med-pulse {
    width: 140px;
    height: auto;
    bottom: 22%;
    right: 8%;
    opacity: 0.3;
}

.login-med-art .med-syringe {
    width: 96px;
    height: auto;
    bottom: 12%;
    left: 10%;
    opacity: 0.2;
    transform: rotate(28deg);
}

.login-med-art .med-pill {
    width: 48px;
    height: auto;
    top: 42%;
    left: 8%;
    opacity: 0.18;
    transform: rotate(-20deg);
}

@keyframes medFloat {
    0%, 100% { transform: translateY(0) rotate(-12deg); }
    50% { transform: translateY(-8px) rotate(-10deg); }
}

@keyframes medPulseSoft {
    0%, 100% { opacity: 0.26; }
    50% { opacity: 0.38; }
}

.login-med-art .med-stethoscope {
    animation: medFloat 7s ease-in-out infinite;
}

.login-med-art .med-pulse {
    animation: medPulseSoft 4.5s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    .login-med-art .med-stethoscope,
    .login-med-art .med-pulse { animation: none !important; }
}

.login-left-top,
.welcome-text {
    position: relative;
    z-index: 1;
}

.lumina-logo-wrap {
    width: 100%;
    max-width: 200px;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
    animation: loginRise 0.7s 0.08s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.lumina-logo,
.demo-logo-placeholder {
    display: block;
    width: 100%;
    height: auto;
}

.demo-logo-placeholder-wrap {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(254, 205, 211, 0.28);
    box-shadow: none;
}

.welcome-text {
    max-width: 340px;
    animation: loginRise 0.75s 0.14s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-brand-kicker {
    display: inline-block;
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #FB7185;
}

.welcome-text h1,
.login-left h1 {
    font-family: "Instrument Serif", Georgia, serif;
    font-size: clamp(2.35rem, 3.6vw, 3rem);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.05;
    margin-bottom: 16px;
    color: #FAFAFA !important;
    -webkit-text-fill-color: #FAFAFA;
}

.welcome-text p,
.login-left .welcome-text p {
    font-size: 1.125rem;
    line-height: 1.55;
    color: rgba(250, 250, 250, 0.82) !important;
    max-width: 30ch;
}

.welcome-tagline,
.login-left .welcome-tagline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 28px;
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #FFE4E6 !important;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(251, 113, 133, 0.4);
    backdrop-filter: blur(8px);
}

.welcome-tagline::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #F43F5E;
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.25);
}

/* ---- Form panel ---- */
.login-right {
    padding: clamp(36px, 5vw, 56px) clamp(32px, 4.5vw, 52px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--surface);
    animation: loginRise 0.7s 0.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-header {
    margin-bottom: 22px;
}

.login-form-kicker {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--oxide);
}

.login-header h2,
.login-right h2 {
    font-size: clamp(1.75rem, 2.8vw, 2.1rem);
    font-weight: 700;
    color: var(--ink) !important;
    margin-bottom: 8px;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.login-header p {
    color: var(--mist);
    font-size: 1.05rem;
    line-height: 1.5;
    max-width: 38ch;
}

/* Compact MFA notice */
.demo-mfa-panel {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #FFF7F8;
    border: 1px solid #FECDD3;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 20px;
}

.demo-mfa-panel::before {
    content: none;
}

.demo-mfa-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--ink);
    color: #FFE4E6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.demo-mfa-copy {
    min-width: 0;
}

.demo-mfa-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: 0;
}

.demo-mfa-panel h3 {
    display: none;
}

.demo-mfa-panel p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--mist);
    line-height: 1.5;
}

.demo-mfa-panel code {
    font-size: 0.75em;
    background: #fff;
    border: 1px solid #FECDD3;
    border-radius: 4px;
    padding: 1px 5px;
    color: #9F1239;
}

.demo-prefill-status {
    display: none;
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #FFF1F2;
    border: 1px solid #FECDD3;
    color: #9F1239;
    font-size: 0.875rem;
    font-weight: 650;
}

.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    margin-bottom: 7px;
    color: var(--ink);
    font-weight: 650;
    font-size: 0.975rem;
}

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 7px;
}

.label-row label { margin-bottom: 0; }

.forgot-inline {
    color: var(--oxide);
    text-decoration: none;
    font-size: 0.925rem;
    font-weight: 650;
    white-space: nowrap;
}

.forgot-inline:hover {
    color: #BE123C;
    text-decoration: underline;
}

.field-hint {
    display: block;
    margin-top: 7px;
    font-size: 0.9rem;
    color: #71717A;
    line-height: 1.4;
}

.input-group {
    position: relative;
    width: 100%;
    min-width: 0;
}

.input-group.password-group .form-control { padding-right: 48px; }

.input-group > i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #A1A1AA;
    font-size: 15px;
    pointer-events: none;
    transition: color 0.2s ease;
}

.input-group:focus-within > i { color: var(--oxide); }

.form-control {
    width: 100%;
    min-height: 52px;
    padding: 14px 14px 14px 44px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    font-size: 16.5px;
    line-height: 1.35;
    font-family: inherit;
    background: #FAFAFA;
    color: var(--ink);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.form-control::placeholder { color: #A1A1AA; }

.form-control:hover { background: #fff; }

.form-control:focus {
    background: #fff;
    border-color: var(--oxide-md);
    outline: none;
    box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.12);
}

.form-control.input-error {
    border-color: #DC2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 9px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--mist);
    cursor: pointer;
    z-index: 3;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.password-toggle:hover {
    color: var(--oxide);
    background: #FFF1F2;
    border-color: #FECDD3;
}

.password-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.16);
}

.password-toggle i { font-size: 15px; line-height: 1; }

.btn-login {
    width: 100%;
    min-height: 54px;
    margin-top: 6px;
    padding: 15px 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(120deg, #09090B 0%, #18181B 42%, #9F1239 100%);
    background-size: 160% 100%;
    background-position: 0% 50%;
    border: none;
    border-radius: 12px;
    color: #FAFAFA;
    font-size: 1.075rem;
    font-weight: 650;
    font-family: inherit;
    cursor: pointer;
    transition: background-position 0.35s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 12px 28px rgba(9, 9, 11, 0.28);
}

.btn-login i {
    font-size: 13px;
    transition: transform 0.2s ease;
}

.btn-login:hover {
    background-position: 100% 50%;
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(225, 29, 72, 0.28);
}

.btn-login:hover i { transform: translateX(3px); }

.btn-login:active { transform: translateY(0); }

.btn-login:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.2), 0 12px 28px rgba(9, 9, 11, 0.28);
}

.login-support {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    font-size: 0.925rem;
    line-height: 1.55;
    color: #71717A;
    text-align: center;
}

.login-support strong {
    color: var(--ink-soft);
    font-weight: 700;
}

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    line-height: 1.45;
}

.alert-danger {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.alert-success {
    background: #F0FDF4;
    color: #166534;
    border: 1px solid #BBF7D0;
}

.text-danger {
    color: #DC2626;
    font-size: 0.8rem;
    margin-top: 6px;
    display: block;
}

.captcha-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.captcha-image,
.captcha-input {
    flex: 1 1 160px;
    min-width: 0;
}

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

@media (max-width: 860px) {
    .login-container {
        grid-template-columns: 1fr;
        min-height: 0;
    }
    .login-left {
        padding: 28px 24px 24px;
        min-height: 240px;
    }
    .welcome-text p.welcome-text--long { display: none; }
    .welcome-text h1 { font-size: 2rem; }
    .login-med-art .med-syringe,
    .login-med-art .med-pill { display: none; }
    .login-med-art .med-stethoscope { width: 120px; top: 12%; right: -8px; }
}

@media (max-width: 480px) {
    .login-stage { padding: 12px 12px 20px; align-items: flex-start; }
    .login-container { border-radius: 16px; }
    .login-right { padding: 26px 20px 28px; }
    .label-row { flex-wrap: wrap; }
}
