/* =========================================================
   SIGAP - LOGIN
   Struktur mengikuti login SIKONTRAK; warna mengikuti tema SIGAP
   (merah #c90018, emas #ffc928, navy #071f4b). Tanpa dependensi CDN.
========================================================= */

:root {
    --red: #c90018;
    --red-dark: #8f0012;
    --gold: #ffc928;
    --navy: #071f4b;
    --navy-dark: #03132f;
    --ink: #10264a;
    --muted: #64748b;
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    font-family: "Segoe UI", "Inter", Arial, sans-serif;
    color: #172033;
    overflow-x: hidden;
    background: var(--navy-dark);
}

button,
input,
select {
    font-family: inherit;
}

.login-page {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--navy-dark);
}

.login-shell {
    position: relative;
    width: min(1536px, 100vw);
    min-height: 100vh;
    display: grid;
    grid-template-columns: 59.3% 40.7%;
    overflow: hidden;
    background: var(--navy-dark);
}

/* =========================================================
   LEFT VISUAL
========================================================= */

.login-visual {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background: var(--navy);
}

.visual-image {
    position: absolute;
    inset: 0;
    background-image: url("/images/header-natuna.jpg");
    background-size: cover;
    background-position: center 45%;
    transform: scale(1.015);
    animation: slowZoom 18s ease-in-out infinite alternate;
}

.visual-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(3, 19, 47, .78) 0%, rgba(3, 19, 47, .10) 38%, rgba(3, 19, 47, .10) 55%, rgba(3, 19, 47, .88) 100%),
        linear-gradient(90deg, rgba(7, 31, 75, .72) 0%, rgba(7, 31, 75, .25) 60%, rgba(143, 0, 18, .22) 100%);
    pointer-events: none;
}

.visual-ribbon {
    position: absolute;
    left: -30px;
    bottom: -40px;
    width: 155px;
    height: 330px;
    transform: rotate(36deg);
    pointer-events: none;
    opacity: .95;
}

.ribbon-red {
    background: var(--red);
    border-right: 13px solid var(--gold);
}

.ribbon-blue {
    left: 6px;
    border-right: 14px solid #073b85;
}

.visual-content {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    padding: 46px 60px 56px 130px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    text-shadow: 0 2px 6px rgba(0, 16, 44, .45);
}

.visual-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.visual-brand img {
    width: 56px;
    height: 67px;
    object-fit: contain;
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .35));
}

.visual-brand span {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.2px;
    opacity: .92;
}

.visual-brand strong {
    display: block;
    font-size: 22px;
    letter-spacing: 2px;
}

.visual-text h2 {
    margin: 0 0 10px;
    font-size: clamp(54px, 5.2vw, 82px);
    font-weight: 850;
    letter-spacing: 3px;
    line-height: 1;
}

.visual-text h2::after {
    content: "";
    display: block;
    width: 84px;
    height: 5px;
    margin-top: 16px;
    border-radius: 4px;
    background: var(--gold);
}

.visual-subtitle {
    margin: 0 0 14px;
    font-size: clamp(17px, 1.5vw, 22px);
    font-weight: 650;
    line-height: 1.4;
}

.visual-tagline {
    margin: 0;
    max-width: 440px;
    font-size: 15px;
    line-height: 1.65;
    opacity: .94;
}

/* =========================================================
   RIGHT PANEL
========================================================= */

.login-panel {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 42px;
    background:
        radial-gradient(circle at 100% 0%, rgba(201, 0, 24, .06), transparent 28%),
        #ffffff;
}

.login-card {
    width: 100%;
    max-width: 520px;
    animation: panelAppear .75s ease-out both;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 22px;
}

.login-logo img {
    display: block;
    width: 62px;
    height: auto;
    object-fit: contain;
}

.login-logo-name {
    color: var(--red);
    font-size: 40px;
    font-weight: 850;
    letter-spacing: 2px;
    line-height: 1;
}

.login-header {
    margin-bottom: 34px;
    text-align: center;
}

.login-header h1 {
    margin: 0 0 12px;
    color: var(--ink);
    font-size: clamp(27px, 2vw, 34px);
    font-weight: 800;
    letter-spacing: -.8px;
    line-height: 1.2;
}

.login-header p {
    margin: 0 auto;
    max-width: 430px;
    color: var(--muted);
    font-size: 15.5px;
    line-height: 1.7;
}

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

/* =========================================================
   FORM
========================================================= */

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

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: #13264b;
    font-size: 15px;
    font-weight: 600;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    z-index: 2;
    left: 21px;
    top: 50%;
    transform: translateY(-50%);
    color: #8b9ab5;
    pointer-events: none;
    transition: color .2s ease;
}

.form-input {
    width: 100%;
    height: 64px;
    padding: 0 58px;
    border: 1.5px solid #d7dfec;
    border-radius: 13px;
    outline: none;
    background: #fff;
    color: #16284d;
    font-size: 16px;
    transition: border-color .2s ease, box-shadow .2s ease;
}

/* Dropdown tahun anggaran: tampilan sama dengan input, panah bawaan browser diganti. */
select.form-input {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 54px;
    cursor: pointer;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b9ab5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
    background-repeat: no-repeat;
    background-position: right 20px center;
    background-size: 18px;
}

.form-input::placeholder {
    color: #8a97b0;
}

.form-input:hover {
    border-color: #bdc9db;
}

.form-input:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 4px rgba(201, 0, 24, .09);
}

.input-wrapper:focus-within .input-icon {
    color: var(--red);
}

.password-toggle {
    position: absolute;
    z-index: 3;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #8b9ab5;
    cursor: pointer;
    transition: .2s ease;
}

.password-toggle:hover {
    background: #fff1f2;
    color: var(--red);
}

.password-toggle .icon-off {
    display: none;
}

.password-toggle.is-visible .icon-on {
    display: none;
}

.password-toggle.is-visible .icon-off {
    display: block;
}

/* =========================================================
   LOGIN BUTTON
========================================================= */

.login-button {
    width: 100%;
    height: 66px;
    margin-top: 8px;
    border: 0;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    background: linear-gradient(135deg, #d4001b, var(--red-dark));
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 25px rgba(201, 0, 24, .24);
    transition: transform .2s ease, box-shadow .2s ease;
}

.login-button svg {
    transition: transform .2s ease;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 17px 32px rgba(201, 0, 24, .32);
}

.login-button:hover svg {
    transform: translateX(5px);
}

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

.login-button:focus-visible {
    outline: 3px solid rgba(255, 201, 40, .75);
    outline-offset: 3px;
}

.login-button.loading {
    pointer-events: none;
    opacity: .85;
}

.login-button.loading span {
    font-size: 0;
}

.login-button.loading span::after {
    content: "Memproses...";
    font-size: 16px;
}

.login-button.loading svg {
    display: none;
}

.login-help {
    margin: 22px 0 0;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

/* =========================================================
   FOOTER
========================================================= */

.login-footer {
    margin-top: 36px;
    text-align: center;
}

.footer-heading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 13px;
    color: #8a96ad;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1.3px;
}

.footer-heading span {
    width: 28px;
    height: 1px;
    background: #ccd6e5;
}

.login-footer p {
    margin: 12px 0 4px;
    color: #8c99b0;
    font-size: 13px;
}

.login-footer small {
    color: #9ca8bc;
    font-size: 12px;
}

/* =========================================================
   MOBILE BRAND
========================================================= */

.mobile-brand {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 26px;
}

.mobile-brand img {
    width: 46px;
    height: 55px;
    object-fit: contain;
}

.mobile-brand div {
    display: flex;
    flex-direction: column;
}

.mobile-brand span {
    color: #66748d;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .6px;
}

.mobile-brand strong {
    color: var(--ink);
    font-size: 18px;
    letter-spacing: 1px;
}

/* =========================================================
   ERROR / VALIDATION
========================================================= */

.login-alert {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    width: 100%;
    margin: 0 0 24px;
    padding: 17px 48px 17px 17px;
    overflow: hidden;
    color: #7f1d1d;
    background: linear-gradient(135deg, rgba(255, 255, 255, .88), rgba(254, 242, 242, .96));
    border: 1px solid #fecaca;
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(220, 38, 38, .08);
    animation: loginAlertIn .35s ease-out;
    transition: opacity .22s ease, transform .22s ease, margin .22s ease, padding .22s ease;
}

.login-alert::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
    content: "";
    background: linear-gradient(180deg, #ef4444, #dc2626);
}

.login-alert-icon {
    display: inline-flex;
    flex: 0 0 46px;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    color: #dc2626;
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border: 1px solid rgba(248, 113, 113, .22);
    border-radius: 50%;
    box-shadow: 0 6px 16px rgba(220, 38, 38, .12);
}

.login-alert-content {
    flex: 1 1 auto;
    min-width: 0;
    padding-top: 1px;
}

.login-alert-title {
    margin-bottom: 4px;
    color: #b91c1c;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.35;
}

.login-alert-message {
    color: #7f1d1d;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.65;
}

.login-alert-close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    color: #9f6a6a;
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: color .2s ease, background-color .2s ease;
}

.login-alert-close:hover {
    color: #b91c1c;
    background: rgba(254, 202, 202, .55);
}

.login-alert-close:focus-visible {
    outline: 3px solid rgba(239, 68, 68, .18);
    outline-offset: 2px;
}

.login-alert.is-hiding {
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    transform: translateY(-8px);
}

.field-validation-error {
    display: block;
    min-height: 18px;
    margin-top: 7px;
    color: #dc2626;
    font-size: 12px;
    font-weight: 600;
}

.input-validation-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, .08) !important;
}

/* =========================================================
   ANIMATIONS
========================================================= */

@keyframes slowZoom {
    from { transform: scale(1.015); }
    to   { transform: scale(1.06); }
}

@keyframes panelAppear {
    from { opacity: 0; transform: translateX(22px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes loginAlertIn {
    from { opacity: 0; transform: translateY(-10px) scale(.985); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1050px) {
    .login-shell {
        grid-template-columns: 56% 44%;
    }

    .login-panel {
        padding: 35px 30px;
    }

    .login-card {
        max-width: 440px;
    }

    .visual-content {
        padding-left: 100px;
    }
}

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

    .login-visual {
        display: none;
    }

    .login-panel {
        min-height: 100vh;
        padding: 35px 25px;
    }

    .mobile-brand {
        display: flex;
    }

    .login-logo {
        display: none;
    }

    .login-card {
        max-width: 500px;
    }
}

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

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

    .login-header h1 {
        font-size: 26px;
    }

    .login-header p {
        font-size: 14px;
    }

    .form-input {
        height: 58px;
        font-size: 14px;
    }

    .login-button {
        height: 60px;
        font-size: 16px;
    }

    .login-alert {
        gap: 11px;
        padding: 14px 42px 14px 14px;
        border-radius: 13px;
    }

    .login-alert-icon {
        flex-basis: 40px;
        width: 40px;
        height: 40px;
    }

    .login-alert-title {
        font-size: 14px;
    }

    .login-alert-message {
        font-size: 12.5px;
        line-height: 1.55;
    }
}

/* Form kini punya 3 field: padatkan sedikit di layar yang tidak terlalu tinggi
   agar kartu login tetap muat tanpa scroll. */
@media (min-width: 821px) and (max-height: 1100px) {
    .login-logo {
        margin-bottom: 14px;
    }

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

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

    .form-input {
        height: 58px;
    }

    .login-button {
        height: 60px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
