/**
 * Login page — Sayas Group ERP
 */
:root {
    --navy:       #032d5c;
    --navy-mid:   #0a4a7a;
    --navy-dark:  #021a33;
    --gold:       #c9a227;
    --gold-light: #e5cf7a;
    --gold-btn:   #ffc107;
    --logo-blue:  #2b4a70;
    --muted:      #64748b;
    --line:       rgba(3,45,92,0.1);
    --radius:     14px;
    --font-ui:    "Montserrat", system-ui, sans-serif;
    --font-brand: Georgia, "Times New Roman", Times, serif;
    --ease-out:   cubic-bezier(0.22, 1, 0.36, 1);
}

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

body {
    margin: 0;
    min-height: 100vh;
    padding: 20px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-ui);
    background:
        radial-gradient(ellipse 130% 90% at 8% 15%,  rgba(201,162,39,0.10) 0%, transparent 48%),
        radial-gradient(ellipse 100% 80% at 92% 85%,  rgba(3,45,92,0.09)   0%, transparent 42%),
        radial-gradient(ellipse 60%  60% at 55% 50%,  rgba(10,74,122,0.04) 0%, transparent 55%),
        linear-gradient(155deg, #e8ecf2 0%, #f4f0e7 45%, #dce4ee 100%);
}

/* ── Card shell ──────────────────────────────────── */
.container-wrapper {
    width: 100%;
    max-width: 980px;
    min-height: 540px;
    display: flex;
    overflow: hidden;
    background: #fff;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.9);
    box-shadow:
        0 2px 4px  rgba(3,45,92,0.03),
        0 8px 20px rgba(3,45,92,0.08),
        0 28px 56px -16px rgba(3,45,92,0.18),
        inset 0 0 0 1px rgba(3,45,92,0.04);
    animation: cardIn 0.55s var(--ease-out) both;
}

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

/* ── Left panel ───────────────────────────────────── */
.left-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 540px;
    overflow: hidden;
    background: var(--navy);
    position: relative;
}

.left-panel__visual {
    position: relative;
    flex: 1 1 56%;
    min-height: 200px;
    overflow: hidden;
    background: #c8d3e0;
}

.left-panel__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 8s ease;
}
.left-panel:hover .left-panel__img { transform: scale(1.03); }

.left-panel__visual::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 40%,
        rgba(3,45,92,0.15) 65%,
        rgba(3,45,92,0.45) 100%
    );
    pointer-events: none;
}

.left-panel__inner {
    flex: 0 0 auto;
    padding: 1.35rem 1.6rem 1.6rem;
    background: linear-gradient(180deg, #043057, var(--navy));
    border-top: 2.5px solid var(--gold);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.14);
}

.left-panel__title {
    margin: 0 0 0.7rem;
    font-size: inherit;
    font-weight: inherit;
    line-height: 1;
}

.left-panel__title-box {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.3em;
    padding: 0.5rem 1rem;
    border: 2px solid var(--gold-btn);
    border-radius: 3px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(0,0,0,0.2), inset 0 0 0 1px rgba(43,74,112,0.07);
    font-family: var(--font-brand);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.2;
}

.left-panel__title-sayas  { color: var(--logo-blue); }
.left-panel__title-group  { color: var(--gold-btn); }
.left-panel__title-erp {
    margin-inline-start: 0.15em;
    font-family: var(--font-ui);
    font-size: 0.7em;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #3d5678;
}

.left-panel__tagline {
    margin: 0 0 0.8rem;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.6;
    color: rgba(255,255,255,0.88);
}

.left-panel__divider {
    width: 2.25rem;
    height: 2px;
    margin: 0 0 0.7rem;
    border-radius: 1px;
    background: linear-gradient(90deg, var(--gold), transparent);
}

.left-panel__note {
    margin: 0;
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.55;
    color: rgba(255,255,255,0.7);
}
.left-panel__note a {
    font-weight: 600;
    color: #fff;
    text-decoration: underline;
    text-decoration-color: rgba(201,162,39,0.8);
    text-underline-offset: 2px;
    transition: color 0.15s;
}
.left-panel__note a:hover { color: var(--gold-light); text-decoration-color: var(--gold); }

/* ── Right panel ──────────────────────────────────── */
.right-panel {
    position: relative;
    flex: 0.95;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 38px 40px 44px;
    border-left: 1px solid var(--line);
    background: linear-gradient(175deg, #ffffff 0%, #f8fafc 52%, #f1f5f9 100%);
    overflow: hidden;
}

/* Subtle decorative circle */
.right-panel::after {
    content: "";
    position: absolute;
    bottom: -90px;
    right: -90px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201,162,39,0.06) 0%, transparent 70%);
    pointer-events: none;
}

.right-panel::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    pointer-events: none;
    background: linear-gradient(180deg, var(--gold) 0%, rgba(201,162,39,0.15) 65%, transparent 100%);
}

.right-panel__inner {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    animation: formIn 0.6s 0.15s var(--ease-out) both;
}

@keyframes formIn {
    from { opacity:0; transform: translateY(12px); }
    to   { opacity:1; transform: translateY(0); }
}

.login-translate-wrap {
    position: absolute;
    top: 16px;
    right: 16px;
}

.right-panel__eyebrow {
    margin: 0 0 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-align: center;
    text-transform: uppercase;
    color: var(--muted);
}

.right-panel h3 {
    margin: 0 0 24px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-align: center;
    color: var(--navy);
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
}
.logo-container img {
    width: auto;
    max-width: 100%;
    max-height: 118px;
    border-radius: 10px;
}

/* ── Inputs ───────────────────────────────────────── */
.icon-input {
    position: relative;
    margin-bottom: 6px;
}

.icon-input .field-icon-left {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.95rem;
    color: var(--muted);
    pointer-events: none;
    transition: color 0.2s;
    z-index: 1;
}

.icon-input input {
    width: 100%;
    padding: 12px 40px 12px 42px;
    border: 1.5px solid var(--line);
    border-radius: 11px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--navy);
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.icon-input input::placeholder { color: #a0aec0; }

.icon-input input:hover {
    border-color: rgba(3,45,92,0.2);
    background: #fdfeff;
}

.icon-input input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3.5px rgba(201,162,39,0.14);
    background: #fff;
}

.icon-input:focus-within .field-icon-left { color: var(--gold); }

/* ── Password toggle ──────────────────────────────── */
.btn-toggle-pw {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.18s, background 0.18s;
    -webkit-tap-highlight-color: transparent;
}
.btn-toggle-pw:hover {
    color: var(--navy);
    background: rgba(3,45,92,0.06);
}
.btn-toggle-pw:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 1px;
}
.btn-toggle-pw svg {
    width: 16px;
    height: 16px;
    display: block;
    pointer-events: none;
}

/* password input padding adjusted for toggle */
.icon-input.has-toggle input { padding-right: 44px; }

/* ── Remember / Forgot ───────────────────────────── */
.small-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted);
}

.small-options label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.small-options input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--navy);
    cursor: pointer;
}

.small-options a {
    font-weight: 700;
    color: var(--navy);
    text-decoration: none;
    border-bottom: 1.5px solid rgba(201,162,39,0.45);
    padding-bottom: 1px;
    transition: color 0.15s, border-color 0.15s;
}
.small-options a:hover { color: var(--gold); border-color: var(--gold); }

/* ── Login button ─────────────────────────────────── */
.btn-login {
    position: relative;
    width: 100%;
    margin-top: 18px;
    padding: 12.5px 18px;
    border: none;
    border-radius: 11px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(145deg, var(--navy-mid) 0%, var(--navy) 50%, var(--navy-dark) 100%);
    box-shadow:
        0 3px 0 rgba(2,13,26,0.4),
        0 4px 16px rgba(3,45,92,0.26),
        inset 0 1px 0 rgba(255,255,255,0.14);
    transition: transform 0.15s var(--ease-out), box-shadow 0.18s, background 0.2s;
    overflow: hidden;
}
.btn-login::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, transparent 60%);
    border-radius: inherit;
    pointer-events: none;
}
.btn-login:hover {
    transform: translateY(-2px);
    box-shadow:
        0 5px 0 rgba(2,13,26,0.38),
        0 10px 28px rgba(3,45,92,0.34),
        inset 0 1px 0 rgba(255,255,255,0.14);
}
.btn-login:active {
    transform: translateY(1px);
    box-shadow:
        0 1px 0 rgba(2,13,26,0.4),
        0 2px 8px rgba(3,45,92,0.22),
        inset 0 1px 0 rgba(255,255,255,0.14);
}
.btn-login:focus-visible {
    outline: 2.5px solid var(--gold);
    outline-offset: 2px;
}

/* Loading state */
.btn-login.loading {
    pointer-events: none;
    opacity: 0.8;
}
.btn-login .btn-spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}
.btn-login.loading .btn-spinner { display: inline-block; }

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

/* ── Alert ────────────────────────────────────────── */
.alert-danger,
.alert-success {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    margin-bottom: 4px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 600;
    color: #fff;
    animation: alertIn 0.3s var(--ease-out) both;
}
.alert-danger {
    background: linear-gradient(135deg, #dc2626, #991b1b);
    box-shadow: 0 2px 10px rgba(220,38,38,0.25);
}
.alert-danger::before {
    content: "⚠";
    font-size: 14px;
    flex-shrink: 0;
}
.alert-success {
    background: linear-gradient(135deg, #15803d, #166534);
    box-shadow: 0 2px 10px rgba(21,128,61,0.25);
}
.alert-success::before {
    content: "✓";
    font-size: 14px;
    flex-shrink: 0;
}

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

/* ── Responsive — mobile shows login form only ───── */
@media (max-width: 991px) {
    body {
        padding: 0;
        align-items: stretch;
        background: linear-gradient(175deg, #ffffff 0%, #f8fafc 52%, #f1f5f9 100%);
    }

    .left-panel {
        display: none;
    }

    .container-wrapper {
        flex-direction: column;
        width: 100%;
        max-width: none;
        min-height: 100vh;
        min-height: 100dvh;
        border-radius: 0;
        border: none;
        box-shadow: none;
        animation: none;
    }

    .right-panel {
        flex: 1;
        width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        padding: 32px 24px 38px;
        border: none;
    }

    .right-panel::before,
    .right-panel::after {
        display: none;
    }

    .login-translate-wrap {
        top: 12px;
        right: 12px;
    }
}

.login-env-badge {
    margin: 18px 0 0;
    padding: 8px 12px;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--navy);
    background: rgba(3, 45, 92, 0.05);
    border: 1px solid rgba(3, 45, 92, 0.12);
    border-radius: 10px;
}

@media (max-width: 480px) {
    .right-panel {
        padding: 28px 20px 32px;
    }

    .logo-container img {
        max-height: 96px;
    }
}
