/* SIBLUD — Login Retribusi (ilustrasi + pesawat asap) */
:root {
    --rt-green: #0d5c4d;
    --rt-green-m: #147a66;
    --rt-green-l: #1a9b82;
    --rt-teal: #0f766e;
    --rt-sky: #7ec8e3;
    --rt-text: #1e293b;
    --rt-muted: #64748b;
    --rt-card: rgba(255, 255, 255, 0.88);
    --rt-border: rgba(255, 255, 255, 0.7);
    --rt-radius: 22px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    height: 100%;
}

html,
body.rt-login-page {
    margin: 0;
    width: 100%;
    min-height: 100%;
    min-height: 100dvh;
}

body.rt-login-page {
    font-family: "Plus Jakarta Sans", "Nunito", system-ui, sans-serif;
    color: var(--rt-text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    background: #7ec8e3;
    height: 100%;
    min-height: 100dvh;
}

/* —— Background —— */
.rt-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    background-color: #7ec8e3;
    overflow: hidden;
    background-image: var(--rt-bg-url, none);
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 100% 100%;
}

.rt-bg-img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
    object-position: center center;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    image-rendering: auto;
}

.rt-bg picture {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

.rt-bg-veil {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: transparent;
}

.rt-smoke-canvas {
    position: fixed;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.rt-plane-layer {
    position: fixed;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    overflow: hidden;
}

.rt-plane {
    position: absolute;
    left: 0;
    top: 0;
    width: 88px;
    height: auto;
    filter: drop-shadow(0 8px 14px rgba(15, 50, 70, 0.35));
    will-change: transform;
    opacity: 1;
}

.rt-plane.is-sm {
    width: 64px;
}
.rt-plane.is-md {
    width: 76px;
}
.rt-plane.is-lg {
    width: 96px;
}

.rt-plane svg {
    display: block;
    width: 100%;
    height: auto;
}

/* Trail asap (CSS) */
.rt-plane-smoke {
    position: absolute;
    right: 78%;
    top: 42%;
    width: 90px;
    height: 18px;
    pointer-events: none;
    background: radial-gradient(
        ellipse at right,
        rgba(255, 255, 255, 0.85) 0%,
        rgba(255, 255, 255, 0.35) 40%,
        transparent 70%
    );
    filter: blur(3px);
    opacity: 0.75;
    animation: rtSmokePulse 1.2s ease-in-out infinite;
}

.rt-plane.is-sm .rt-plane-smoke {
    width: 60px;
    height: 12px;
    right: 76%;
}
.rt-plane.is-md .rt-plane-smoke {
    width: 72px;
    height: 14px;
}

@keyframes rtSmokePulse {
    0%,
    100% {
        opacity: 0.45;
        transform: scaleX(0.85);
    }
    50% {
        opacity: 0.9;
        transform: scaleX(1.1);
    }
}

/* Jalur terbang 3 pesawat */
.rt-plane[data-plane="0"] {
    animation: rtFlyAcrossA 11s linear infinite;
}

.rt-plane[data-plane="1"] {
    animation: rtFlyAcrossB 9s linear infinite;
    animation-delay: -3s;
}

.rt-plane[data-plane="2"] {
    animation: rtFlyAcrossC 13s linear infinite;
    animation-delay: -6s;
}

@keyframes rtFlyAcrossA {
    0% {
        transform: translate(-140px, 12vh) rotate(-6deg);
    }
    25% {
        transform: translate(25vw, 16vh) rotate(4deg);
    }
    50% {
        transform: translate(50vw, 10vh) rotate(-3deg);
    }
    75% {
        transform: translate(75vw, 15vh) rotate(5deg);
    }
    100% {
        transform: translate(calc(100vw + 140px), 12vh) rotate(-4deg);
    }
}

@keyframes rtFlyAcrossB {
    0% {
        transform: translate(-140px, 28vh) rotate(-4deg);
    }
    30% {
        transform: translate(30vw, 24vh) rotate(6deg);
    }
    55% {
        transform: translate(55vw, 32vh) rotate(-5deg);
    }
    80% {
        transform: translate(80vw, 26vh) rotate(3deg);
    }
    100% {
        transform: translate(calc(100vw + 140px), 30vh) rotate(-2deg);
    }
}

@keyframes rtFlyAcrossC {
    0% {
        transform: translate(calc(100vw + 140px), 40vh) rotate(4deg) scaleX(-1);
    }
    35% {
        transform: translate(65vw, 36vh) rotate(-5deg) scaleX(-1);
    }
    60% {
        transform: translate(40vw, 44vh) rotate(3deg) scaleX(-1);
    }
    100% {
        transform: translate(-160px, 38vh) rotate(-4deg) scaleX(-1);
    }
}

/* —— Layout / overlay form —— */
.rt-login-overlay {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem 2rem;
    /* jangan buramkan seluruh background — hanya redup tipis */
    background: rgba(8, 30, 40, 0.12);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}

body.is-login-open .rt-login-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.rt-wrap {
    position: relative;
    z-index: 10;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rt-card {
    width: 100%;
    max-width: 420px;
    background: var(--rt-card);
    /* blur hanya di dalam kartu, bukan di seluruh layar */
    backdrop-filter: blur(8px) saturate(1.15);
    -webkit-backdrop-filter: blur(8px) saturate(1.15);
    border: 1px solid var(--rt-border);
    border-radius: var(--rt-radius);
    box-shadow:
        0 24px 56px rgba(15, 40, 55, 0.22),
        0 0 0 1px rgba(255, 255, 255, 0.55) inset;
    padding: 2rem 1.75rem 1.35rem;
    position: relative;
    color: #0f172a;
    transform: translateY(24px) scale(0.96);
    opacity: 0;
    transition:
        transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.35s ease;
}

body.is-login-open .rt-card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.rt-card-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(15, 40, 55, 0.12);
    transition:
        background 0.2s,
        color 0.2s;
}

.rt-card-close:hover {
    background: #fff;
    color: var(--rt-green);
}

/* —— Mascot trigger (pojok kanan bawah) —— */
.rt-login-mascot {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 15;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    filter: drop-shadow(0 12px 22px rgba(15, 40, 55, 0.28));
    transition:
        transform 0.25s ease,
        opacity 0.3s ease,
        visibility 0.3s ease;
    animation: rtMascotBob 2.8s ease-in-out infinite;
}

.rt-login-mascot:hover {
    transform: translateY(-4px) scale(1.04);
    animation-play-state: paused;
}

.rt-login-mascot:focus-visible {
    outline: 3px solid rgba(26, 155, 130, 0.55);
    outline-offset: 4px;
    border-radius: 16px;
}

body.is-login-open .rt-login-mascot {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(16px) scale(0.9);
}

.rt-mascot-figure {
    display: block;
    width: 148px;
    height: auto;
    line-height: 0;
}

.rt-mascot-figure svg {
    display: block;
    width: 100%;
    height: auto;
}

.rt-mascot-bubble {
    position: absolute;
    top: 8px;
    left: -8px;
    background: #fff;
    color: var(--rt-green);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 6px 12px;
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(15, 40, 55, 0.16);
    animation: rtBubblePulse 2s ease-in-out infinite;
}

.rt-mascot-bubble::after {
    content: "";
    position: absolute;
    right: 14px;
    bottom: -6px;
    width: 10px;
    height: 10px;
    background: #fff;
    transform: rotate(45deg);
}

.rt-mascot-hint {
    margin-top: 2px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    background: rgba(13, 92, 77, 0.72);
    padding: 4px 10px;
    border-radius: 999px;
}

@keyframes rtMascotBob {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes rtBubblePulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.06);
    }
}

.rt-brand {
    text-align: center;
    margin-bottom: 1.35rem;
}

.rt-logo-img {
    display: block;
    margin: 0 auto;
    width: 100%;
    max-width: 280px;
    max-height: 130px;
    height: auto;
    object-fit: contain;
}

/* —— Form —— */
.rt-card .login-alert-err {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.rt-card .login-field {
    margin-bottom: 1rem;
}

.rt-card .login-field label {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 800;
    color: #064e3b;
    margin-bottom: 0.4rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    border-radius: 999px;
    padding: 0.22rem 0.7rem;
}

.rt-card .login-input-wrap {
    position: relative;
}

.rt-card .login-input-wrap > i.field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #0f766e;
    font-size: 0.92rem;
    pointer-events: none;
    z-index: 1;
}

.rt-card .login-input-wrap input,
.rt-card .login-input-wrap select {
    width: 100%;
    height: 50px;
    border: 1.5px solid #64748b;
    border-radius: 12px;
    background: #ffffff;
    padding: 0 14px 0 42px;
    font-size: 0.98rem;
    font-weight: 650;
    font-family: inherit;
    color: #020617;
    outline: none;
    transition:
        border-color 0.2s,
        box-shadow 0.2s;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.rt-card .login-input-wrap.no-icon input {
    padding-left: 14px;
}

.rt-card .login-input-wrap input::placeholder {
    color: #475569;
    font-weight: 550;
    opacity: 1;
}

.rt-card .login-input-wrap input:focus,
.rt-card .login-input-wrap select:focus {
    border-color: #0d9488;
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.18);
}

.rt-card .login-pwd-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #334155;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
}

.rt-card .login-pwd-toggle:hover {
    color: var(--rt-green-m);
}

.rt-card .login-captcha-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ecfdf5;
    border: 1.5px solid #34d399;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    font-weight: 800;
    color: #064e3b;
    font-size: 1.12rem;
}

.rt-card .login-captcha-box i {
    color: #059669;
}

.rt-card .login-check-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 750;
    color: #0f172a;
    margin: 0.2rem 0 1.15rem;
    cursor: pointer;
    user-select: none;
    background: #ffffff;
    border: 1px solid #94a3b8;
    border-radius: 10px;
    padding: 0.45rem 0.75rem;
}

.rt-card .login-check-row input {
    width: 16px;
    height: 16px;
    accent-color: #0d9488;
}

.rt-card .login-btn-submit {
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #0d5c4d 0%, #0f766e 55%, #14b8a6 100%);
    color: #fff;
    font-size: 1.02rem;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 12px 28px rgba(13, 92, 77, 0.38);
    transition:
        transform 0.2s,
        box-shadow 0.2s,
        filter 0.2s;
    position: relative;
}

.rt-card .login-btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(13, 92, 77, 0.45);
    filter: brightness(1.05);
}

.rt-card .login-btn-submit:active {
    transform: translateY(0);
}

.rt-card .login-btn-submit .spin {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: rtSpin 0.7s linear infinite;
}

.rt-card .login-btn-submit.loading .spin {
    display: inline-block;
}
.rt-card .login-btn-submit.loading {
    pointer-events: none;
    opacity: 0.9;
}

@keyframes rtSpin {
    to {
        transform: rotate(360deg);
    }
}

.rt-card .login-form-footer {
    text-align: center;
    margin: 1.15rem 0 0;
    padding: 0.7rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 750;
    color: #0f172a;
    line-height: 1.55;
    background: #f1f5f9;
    border: 1px solid #94a3b8;
    border-radius: 12px;
}

.rt-corner-badge {
    position: fixed;
    left: 16px;
    bottom: 14px;
    z-index: 12;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 999px;
    padding: 6px 12px 6px 6px;
    font-size: 0.72rem;
    font-weight: 650;
    color: var(--rt-green);
    box-shadow: 0 8px 24px rgba(15, 40, 55, 0.12);
}

.rt-corner-badge img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: contain;
    background: #fff;
}

@media (max-width: 900px), (orientation: portrait) {
    /* HP: full layar, ambil tengah ilustrasi saja */
    body.rt-login-page {
        overflow: hidden;
        height: 100%;
        min-height: 100dvh;
        min-height: 100svh;
    }

    .rt-bg {
        display: block;
        background-color: #7ec8e3;
        background-image: var(--rt-bg-url-mobile, var(--rt-bg-url, none));
        background-repeat: no-repeat;
        background-position: center center;
        background-size: cover;
    }

    .rt-bg picture {
        position: absolute;
        inset: 0;
        display: block;
        width: 100%;
        height: 100%;
    }

    .rt-bg-img {
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        max-height: none !important;
        object-fit: cover !important;
        object-position: center center !important;
        filter: none !important;
    }

    .rt-bg-veil {
        background: transparent;
    }

    .rt-plane.is-lg { width: 56px; }
    .rt-plane.is-md { width: 46px; }
    .rt-plane.is-sm { width: 38px; }

    .rt-login-overlay {
        align-items: flex-start;
        padding: max(1rem, env(safe-area-inset-top)) 0.85rem max(1.25rem, env(safe-area-inset-bottom));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .rt-card {
        width: 100%;
        max-width: 420px;
        margin: auto;
        padding: 1.5rem 1.15rem 1.2rem;
        border-radius: 18px;
    }

    .rt-logo-img {
        max-width: min(240px, 70vw);
        max-height: 96px;
    }

    .rt-login-mascot {
        right: max(10px, env(safe-area-inset-right));
        bottom: max(12px, env(safe-area-inset-bottom));
    }

    .rt-mascot-figure { width: 108px; }

    .rt-corner-badge {
        left: max(8px, env(safe-area-inset-left));
        bottom: max(10px, env(safe-area-inset-bottom));
        max-width: calc(100vw - 130px);
        font-size: 0.62rem;
        padding: 5px 10px 5px 5px;
    }

    .rt-corner-badge span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .rt-corner-badge img {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 480px) {
    .rt-card {
        padding: 1.35rem 1rem 1.1rem;
        border-radius: 16px;
    }

    .rt-logo-img {
        max-width: min(200px, 68vw);
        max-height: 84px;
    }

    .rt-card .login-input-wrap input,
    .rt-card .login-input-wrap select {
        height: 48px;
        font-size: 1rem; /* cegah zoom iOS */
    }

    .rt-card .login-btn-submit {
        height: 50px;
    }

    /* Satu pesawat saja biar tidak ramai */
    .rt-plane.is-md,
    .rt-plane.is-sm {
        display: none;
    }

    .rt-mascot-figure {
        width: 96px;
    }
    .rt-mascot-bubble {
        font-size: 0.7rem;
        padding: 5px 10px;
    }
    .rt-mascot-hint {
        font-size: 0.62rem;
        padding: 3px 8px;
    }

    .rt-corner-badge {
        max-width: calc(100vw - 118px);
        font-size: 0.58rem;
    }
}

/* HP sangat sempit */
@media (max-width: 360px) {
    .rt-mascot-figure {
        width: 84px;
    }
    .rt-corner-badge span {
        display: none;
    }
    .rt-corner-badge {
        padding: 4px;
        border-radius: 50%;
        max-width: none;
    }
}

/* HP landscape pendek */
@media (max-height: 480px) and (orientation: landscape) {
    .rt-bg-img {
        object-fit: cover !important;
        object-position: center center !important;
    }

    .rt-mascot-figure {
        width: 72px;
    }
    .rt-mascot-hint {
        display: none;
    }
    .rt-corner-badge {
        display: none;
    }

    .rt-login-overlay {
        padding: 0.5rem;
    }

    .rt-card {
        padding: 1rem 1rem 0.85rem;
        max-height: calc(100dvh - 1rem);
        overflow-y: auto;
    }

    .rt-logo-img {
        max-height: 56px;
        max-width: 160px;
    }

    .rt-brand {
        margin-bottom: 0.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rt-plane,
    .rt-plane-smoke,
    .rt-login-mascot,
    .rt-mascot-bubble {
        animation: none !important;
    }
    .rt-card,
    .rt-login-overlay {
        transition: none !important;
    }
    .rt-plane {
        display: none;
    }
}
