/* ================================================================
   Login Page Styles — public/css/login/style.css
   ================================================================ */

/* ── Variables ── */
:root {
    --bg: #f2f1ed;
    --bg-card: #ffffff;
    --bg-accent: #e8e6df;
    --text-primary: #18181f;
    --text-muted: #6a6a7a;
    --border: #d6d3ca;
    --input-bg: #f8f7f4;
    --accent: #1e3a8a;
    --accent-hover: #143072;
    --accent-light: #eef2ff;
    --accent-rgb: 30, 58, 138;
    --danger: #b91c1c;
    --danger-bg: rgba(185, 28, 28, 0.07);
    --danger-border: rgba(185, 28, 28, 0.3);
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.13);
    --radius: 12px;
    --tr: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --left-bg: #1e3a8a;
}
[data-theme="dark"] {
    --bg: #0d0d17;
    --bg-card: #16162a;
    --bg-accent: #1f1f35;
    --text-primary: #ebebf5;
    --text-muted: #7a7a9a;
    --border: #2a2a42;
    --input-bg: #1f1f35;
    --accent: #6376f8;
    --accent-hover: #5060e0;
    --accent-light: #1e204a;
    --accent-rgb: 99, 118, 248;
    --danger: #f87171;
    --danger-bg: rgba(248, 113, 113, 0.08);
    --danger-border: rgba(248, 113, 113, 0.28);
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.55);
    --left-bg: #1a1a3e;
}

/* ── Reset ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html {
    height: 100%;
}
body {
    font-family: "Poppins", sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition:
        background 0.3s,
        color 0.3s;
    overflow-x: hidden;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(
            ellipse at 15% 15%,
            rgba(var(--accent-rgb), 0.06) 0%,
            transparent 55%
        ),
        radial-gradient(
            ellipse at 85% 85%,
            rgba(var(--accent-rgb), 0.04) 0%,
            transparent 55%
        );
}

/* ── Theme Toggle ── */
.theme-toggle {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 200;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 15px;
    box-shadow: var(--shadow-sm);
    transition: var(--tr);
}
.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: rotate(18deg) scale(1.06);
}

/* ── Layout ── */
.login-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 16px;
    position: relative;
    z-index: 1;
}
.login-container {
    display: flex;
    width: 100%;
    max-width: 940px;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: fadeUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Left Panel ── */
.left-panel {
    width: 42%;
    background: var(--left-bg);
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    min-height: 560px;
}
.left-panel::before {
    content: "";
    position: absolute;
    top: -80px;
    right: -80px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    pointer-events: none;
}
.left-panel::after {
    content: "";
    position: absolute;
    bottom: -50px;
    left: -50px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    pointer-events: none;
}

/* Dots grid */
.dots-grid {
    position: absolute;
    bottom: 28px;
    right: 28px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    opacity: 0.15;
    pointer-events: none;
}
.dots-grid span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #fff;
    display: block;
}

/* Brand */
.brand {
    position: relative;
    z-index: 1;
}
.brand-logo {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 28px;
}
.brand-logo-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    flex-shrink: 0;
}
.brand-logo-text {
    display: flex;
    flex-direction: column;
}
.brand-name {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
    letter-spacing: 0.03em;
}
.brand-unit {
    font-size: 10px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.48);
    margin-top: 1px;
}
.brand-headline {
    font-size: 25px;
    font-weight: 700;
    color: #fff;
    line-height: 1.35;
    margin-bottom: 10px;
}
.brand-headline em {
    font-style: italic;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.65);
}
.brand-sub {
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.65;
    max-width: 220px;
}

/* Illustration */
.illus-wrap {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.illus-svg {
    width: 100%;
    max-width: 255px;
    margin: 0 auto;
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.28));
}
.illus-img {
    width: 100%;
    max-width: 255px;
    margin: 0 auto;
    border-radius: 12px;
    object-fit: cover;
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.28));
}

/* ── Right Panel ── */
.right-panel {
    flex: 1;
    padding: 52px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.form-header {
    margin-bottom: 28px;
}
.eyebrow {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 7px;
}
.form-header h2 {
    font-size: 25px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
    margin-bottom: 5px;
}
.form-header p {
    font-size: 12.5px;
    color: var(--text-muted);
}

/* ── Form Fields ── */
.field-group {
    margin-bottom: 16px;
}

.field-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.field-wrap {
    position: relative;
    transition: var(--tr);
}

/* ── Error state untuk wrapper field (border merah di input) ── */
.field-wrap.is-error .field-input {
    border-color: var(--danger);
    background: var(--danger-bg);
}
.field-wrap.is-error .field-input:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.1);
}
.field-wrap.is-error .field-icon {
    color: var(--danger);
}

.field-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
    transition: color 0.2s;
}
.field-wrap:not(.is-error):focus-within .field-icon {
    color: var(--accent);
}

.field-input {
    width: 100%;
    background: var(--input-bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 11px 13px 11px 38px;
    font-family: "Poppins", sans-serif;
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
    transition: var(--tr);
}
.field-input::placeholder {
    color: var(--text-muted);
    opacity: 0.65;
}
.field-input:not(.is-error):focus {
    border-color: var(--accent);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

/* Suppress browser native eye icon for password */
#passwordInput {
    padding-right: 42px;
}
#passwordInput::-ms-reveal,
#passwordInput::-ms-clear {
    display: none !important;
}
#passwordInput::-webkit-credentials-auto-fill-button,
#passwordInput::-webkit-contacts-auto-fill-button {
    display: none !important;
    visibility: hidden !important;
}

/* Single custom toggle */
.toggle-btn {
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    padding: 3px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}
.toggle-btn:hover {
    color: var(--accent);
}

/* ── Field Error Message ── */
.field-error {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--danger);
    animation: errFadeIn 0.22s ease both;
}
.field-error i {
    font-size: 11px;
    flex-shrink: 0;
}
@keyframes errFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Forgot */
.forgot-link-row {
    display: flex;
    justify-content: flex-end;
    margin-top: -4px;
    margin-bottom: 20px;
}
.forgot-link {
    font-size: 12px;
    color: var(--accent);
    font-weight: 500;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: "Poppins", sans-serif;
    transition: var(--tr);
}
.forgot-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Submit */
.btn-login {
    width: 100%;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 12.5px 20px;
    font-family: "Poppins", sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--tr);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-login:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(var(--accent-rgb), 0.32);
}
.btn-login:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Separator */
.form-sep {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0 0;
    color: var(--text-muted);
    font-size: 10.5px;
}
.form-sep::before,
.form-sep::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.46);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    backdrop-filter: blur(4px);
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.modal-box {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: 20px;
    padding: 38px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95) translateY(14px);
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
}
.modal-overlay.active .modal-box {
    transform: scale(1) translateY(0);
}
.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: var(--bg-accent);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 15px;
    transition: var(--tr);
}
.modal-close:hover {
    background: var(--border);
    color: var(--text-primary);
}
.modal-icon {
    width: 50px;
    height: 50px;
    border-radius: 13px;
    background: var(--accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--accent);
    margin-bottom: 16px;
}
.modal-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.modal-desc {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: 20px;
}
.btn-modal-submit {
    width: 100%;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 12px;
    font-family: "Poppins", sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--tr);
    margin-top: 6px;
}
.btn-modal-submit:hover {
    background: var(--accent-hover);
    box-shadow: 0 6px 18px rgba(var(--accent-rgb), 0.28);
}

/* ── SweetAlert font override ── */
.swal-poppins {
    font-family: "Poppins", sans-serif !important;
}

/* ── Responsive ── */
@media (max-width: 700px) {
    .login-container {
        flex-direction: column;
    }
    .left-panel {
        width: 100%;
        min-height: auto;
        padding: 36px 28px;
    }
    .right-panel {
        padding: 36px 28px;
    }
    .illus-wrap {
        display: none;
    }
}

.logo-icon-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    max-width: 60px;
    max-height: 60px;
}

.brand-logo-icon-wrap {
    width: 60px;
    height: 60px;
    border-radius: 9px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    padding: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.logo-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* contain bukan cover, agar logo tidak terpotong */
    object-position: center;
    display: block;
}
