/* ChemCheemi authentication pages (login + password expired) */
:root {
    --brand: #1d4ed8;
    --brand-dark: #1e3a8a;
    --brand-ink: #0b1b3f;
    --accent: #f1c40f;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --field: #f8fafc;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --success: #16a34a;
    --success-bg: #f0fdf4;
    --warn: #b45309;
    --warn-bg: #fffbeb;
    --radius: 14px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--ink);
    background: #fff;
    -webkit-font-smoothing: antialiased;
}

.auth {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    min-height: 100vh;
}

/* ---------- Visual panel ---------- */
.auth-visual {
    position: relative;
    overflow: hidden;
    color: #fff;
    background: var(--brand-ink);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px 56px;
}

.auth-visual .slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transform: scale(1.06);
    transition: opacity 1.4s ease, transform 7s ease;
}

.auth-visual .slide.is-active { opacity: 1; transform: scale(1); }

.auth-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(11, 27, 63, .55) 0%, rgba(11, 27, 63, .15) 40%, rgba(11, 27, 63, .92) 100%),
        linear-gradient(90deg, rgba(29, 78, 216, .35), rgba(29, 78, 216, 0));
}

.auth-visual > *:not(.slide) { position: relative; z-index: 1; }

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: .2px;
    color: #fff;
    text-decoration: none;
}

.brand img {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .25);
    padding: 2px;
}

.visual-copy { max-width: 540px; }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.6px;
    color: var(--accent);
    margin-bottom: 16px;
}

.eyebrow::before {
    content: "";
    width: 28px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}

.visual-copy h1 {
    font-size: clamp(28px, 3.2vw, 44px);
    line-height: 1.12;
    font-weight: 800;
    margin: 0 0 16px;
    letter-spacing: -.5px;
}

.visual-copy h1 span { color: var(--accent); }

.visual-copy p {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, .82);
}

.visual-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 32px;
}

.dots { display: flex; gap: 8px; }

.dots button {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 99px;
    background: rgba(255, 255, 255, .4);
    cursor: pointer;
    transition: width .3s ease, background .3s ease;
}

.dots button.is-active { width: 28px; background: var(--accent); }

.visual-foot small { color: rgba(255, 255, 255, .65); font-size: 13px; }

/* Security tips (password page) */
.tips { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 12px; }

.tips li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, .88);
}

.tips svg { flex: none; margin-top: 2px; color: var(--accent); }

/* ---------- Form panel ---------- */
.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    background:
        radial-gradient(circle at 100% 0%, rgba(241, 196, 15, .10), transparent 40%),
        radial-gradient(circle at 0% 100%, rgba(29, 78, 216, .08), transparent 45%),
        #fff;
}

.auth-card { width: 100%; max-width: 420px; }

.auth-card .icon-badge {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
    box-shadow: 0 10px 24px -8px rgba(29, 78, 216, .55);
    margin-bottom: 24px;
}

.auth-card .icon-badge.warn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 10px 24px -8px rgba(217, 119, 6, .55);
}

.auth-card h2 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -.4px;
}

.auth-card .lead { margin: 0 0 28px; color: var(--muted); font-size: 15px; line-height: 1.55; }

.lead strong { color: var(--ink); }

/* Alerts */
.alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
    border: 1px solid transparent;
    animation: slideIn .35s ease;
}

.alert svg { flex: none; margin-top: 2px; }
.alert ul { margin: 0; padding-left: 18px; }
.alert p { margin: 0; }
.alert-error { background: var(--danger-bg); color: #991b1b; border-color: #fecaca; }
.alert-success { background: var(--success-bg); color: #166534; border-color: #bbf7d0; }

@keyframes slideIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* Fields */
.field { margin-bottom: 18px; }

.field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #334155;
}

.control { position: relative; }

.control > svg.lead-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    transition: color .2s;
}

.control input {
    width: 100%;
    height: 50px;
    padding: 0 48px 0 44px;
    font: inherit;
    font-size: 15px;
    color: var(--ink);
    background: var(--field);
    border: 1.5px solid var(--line);
    border-radius: 12px;
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.control input::placeholder { color: #a0aec0; }

.control input:hover { border-color: #cbd5e1; }

.control input:focus {
    background: #fff;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(29, 78, 216, .12);
}

.control:focus-within > svg.lead-icon { color: var(--brand); }

.control input[readonly] { background: #f1f5f9; color: #475569; cursor: default; }

.control input.is-invalid { border-color: var(--danger); }
.control input.is-valid { border-color: var(--success); }

.toggle-pass {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
}

.toggle-pass:hover { background: #eef2f7; color: var(--ink); }
.toggle-pass:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.toggle-pass .eye-off { display: none; }
.toggle-pass.is-on .eye { display: none; }
.toggle-pass.is-on .eye-off { display: block; }

.hint {
    display: none;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--warn);
}

.hint.show { display: flex; }
.hint.ok { color: var(--success); }
.hint.bad { color: var(--danger); }

.row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 24px;
    font-size: 14px;
}

.check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #334155;
    user-select: none;
}

.check input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--brand);
    cursor: pointer;
}

.muted-link { color: var(--muted); font-size: 13px; }

/* Button */
.btn {
    position: relative;
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 12px;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .2px;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    box-shadow: 0 12px 24px -10px rgba(29, 78, 216, .6);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform .15s ease, box-shadow .2s ease, filter .2s ease, opacity .2s;
}

.btn:hover { filter: brightness(1.08); box-shadow: 0 16px 30px -12px rgba(29, 78, 216, .7); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid rgba(29, 78, 216, .35); outline-offset: 2px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; filter: grayscale(.2); box-shadow: none; }

.btn .spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, .4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.btn.is-loading .spinner { display: block; }
.btn.is-loading .btn-label { opacity: .85; }

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

.card-foot {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--muted);
}

.card-foot svg { color: var(--success); flex: none; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
    color: var(--brand);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.back-link:hover { text-decoration: underline; }

/* Password strength */
.strength { margin: -6px 0 18px; }

.strength-bar {
    height: 6px;
    border-radius: 99px;
    background: var(--line);
    overflow: hidden;
}

.strength-bar span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 99px;
    background: var(--danger);
    transition: width .3s ease, background .3s ease;
}

.strength-label { margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }

.rules {
    list-style: none;
    margin: 0 0 20px;
    padding: 14px 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    background: var(--field);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.rules li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
    transition: color .2s;
}

.rules li i {
    width: 18px;
    height: 18px;
    flex: none;
    border-radius: 50%;
    border: 1.5px solid #cbd5e1;
    display: grid;
    place-items: center;
    transition: all .2s;
}

.rules li i::after {
    content: "";
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(-1px, -1px);
    opacity: 0;
}

.rules li.ok { color: var(--success); }
.rules li.ok i { background: var(--success); border-color: var(--success); }
.rules li.ok i::after { opacity: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .auth { grid-template-columns: minmax(0, 1fr); }
    .auth-visual { min-height: 260px; padding: 28px 24px; }
    .visual-copy h1 { font-size: 26px; }
    .visual-copy p, .tips, .visual-foot small { display: none; }
    .visual-foot { margin-top: 16px; }
    .auth-panel { padding: 36px 20px 48px; align-items: flex-start; }
}

@media (max-width: 420px) {
    .rules { grid-template-columns: 1fr; }
    .auth-card h2 { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
