/* ============================================================
   LOGIN.CSS — Sampurasun Nusasari Member Portal
   Versi Final — Sudah Diperbaiki (Dropdown & Select)
   ============================================================ */

/* ── 01. VARIABLES & RESET ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --brown-deep:       #1A0800;
    --brown-rich:       #5D2906;
    --orange-warm:      #C45C1A;
    --gold:             #D4A847;
    --gold-light:       #F2D080;
    --gold-dim:         rgba(212, 168, 71, 0.15);
    --white:            #FFFFFF;
    --white-dim:        rgba(255, 255, 255, 0.6);
    --white-faint:      rgba(255, 255, 255, 0.25);
    --card-radius:      24px;
    --input-radius:     12px;
    --btn-radius:       12px;
    --ease-out:         cubic-bezier(0.22, 1, 0.36, 1);
    --transition:       0.3s ease;
    --shadow-card: 0 40px 80px rgba(0,0,0,0.6), 0 20px 40px rgba(0,0,0,0.4), 0 4px 16px rgba(212,168,71,0.08);
    --shadow-btn:       0 6px 24px rgba(196,92,26,0.45);
    --shadow-btn-hover: 0 12px 36px rgba(196,92,26,0.6);
}

html, body {
    width: 100%;
    height: 100%;
    font-family: 'Poppins', sans-serif;
    background: var(--brown-deep);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ── 03. BACKGROUND SCENE & LAYERS ── */
.bg-scene {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: radial-gradient(ellipse 80% 80% at 50% 50%, #6B2205 0%, #3A1203 35%, #1A0800 70%, #0D0400 100%);
}

.bg-batik {
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(60deg, transparent 0px, transparent 38px, rgba(212,168,71,0.035) 38px, rgba(212,168,71,0.035) 39px),
                      repeating-linear-gradient(-60deg, transparent 0px, transparent 38px, rgba(212,168,71,0.035) 38px, rgba(212,168,71,0.035) 39px),
                      repeating-linear-gradient(0deg, transparent 0px, transparent 38px, rgba(212,168,71,0.025) 38px, rgba(212,168,71,0.025) 39px);
    animation: batikDrift 60s linear infinite;
    pointer-events: none;
}

.bg-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 90% 90% at 50% 50%, transparent 40%, rgba(0,0,0,0.7) 100%);
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    animation: orbFloat linear infinite alternate;
}
.orb-1 { width: 600px; height: 600px; background: radial-gradient(circle, rgba(196,92,26,0.28) 0%, transparent 70%); top: -200px; right: -150px; animation-duration: 18s; }
.orb-2 { width: 500px; height: 500px; background: radial-gradient(circle, rgba(93,41,6,0.45) 0%, transparent 70%); bottom: -150px; left: -120px; animation-duration: 22s; animation-delay: -8s; }
.orb-3 { width: 350px; height: 350px; background: radial-gradient(circle, rgba(212,168,71,0.12) 0%, transparent 70%); top: 50%; left: 50%; transform: translate(-50%, -50%); animation-duration: 14s; animation-delay: -4s; }

/* ── 04. MANDALA ── */
.mandala-wrap {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 1;
}
.mandala {
    position: relative;
    width: 700px;
    height: 700px;
    flex-shrink: 0;
}
.mandala-ring {
    position: absolute;
    border-radius: 50%;
    border-style: solid;
    border-color: transparent;
    animation: mandalaRotate var(--rdur, 40s) linear infinite;
}
.mandala-ring:nth-child(1){ inset: 0; border-width: 1px; border-top-color: rgba(212,168,71,0.22); border-right-color: rgba(212,168,71,0.10); --rdur: 45s; }
.mandala-ring:nth-child(2){ inset: 50px; border-width: 1px; border-bottom-color: rgba(212,168,71,0.28); border-left-color: rgba(212,168,71,0.12); --rdur: 35s; animation-direction: reverse; }
.mandala-ring:nth-child(3){ inset: 100px; border-width: 2px; border-top-color: rgba(196,92,26,0.30); border-right-color: rgba(196,92,26,0.15); --rdur: 55s; }
.mandala-ring:nth-child(4){ inset: 150px; border-width: 1px; border-bottom-color: rgba(212,168,71,0.35); border-left-color: rgba(212,168,71,0.18); --rdur: 28s; animation-direction: reverse; }
.mandala-ring:nth-child(5){ inset: 200px; border-width: 2px; border-top-color: rgba(212,168,71,0.40); border-right-color: rgba(212,168,71,0.20); --rdur: 65s; }
.mandala-ring:nth-child(6){ inset: 250px; border-width: 1px; border-bottom-color: rgba(196,92,26,0.38); border-left-color: rgba(196,92,26,0.20); --rdur: 22s; animation-direction: reverse; }
.mandala-ring:nth-child(7){ inset: 300px; border-width: 2px; border-top-color: rgba(212,168,71,0.45); border-right-color: rgba(212,168,71,0.22); --rdur: 38s; }
.mandala-ring::before, .mandala-ring::after {
    content: '';
    position: absolute;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: rgba(212,168,71,0.55);
}
.mandala-ring::before { top: -2.5px; left: 50%; transform: translateX(-50%); }
.mandala-ring::after { bottom: -2.5px; left: 50%; transform: translateX(-50%); }
.mandala-core {
    position: absolute;
    inset: 310px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212,168,71,0.25) 0%, rgba(196,92,26,0.15) 50%, transparent 100%);
    animation: mandalaGlow 5s ease-in-out infinite alternate;
}

/* ── 05. PARTICLES ── */
.particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}
.particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(212,168,71,0.7);
    animation: particleDrift var(--dur, 10s) var(--delay, 0s) ease-in-out infinite alternate;
}

/* ── 06. PAGE LAYOUT ── */
.page-wrap {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    overflow: hidden;
    perspective: 1200px;
}

/* ── 07. 3D CARD WRAPPER ── */
.login-card {
    width: 100%;
    max-width: 460px;
    animation: card3DReveal 1s var(--ease-out) both;
    transform: rotateX(2deg);
    transform-style: preserve-3d;
    transition: transform 0.6s var(--ease-out);
}
.login-card:hover {
    transform: rotateX(var(--rx, 1deg)) rotateY(var(--ry, 0deg));
}

/* ── 08. BRAND HEADER ── */
.brand-header {
    margin-bottom: 10px;
    text-align: center;
    animation: fadeSlideUp 0.8s 0.15s var(--ease-out) both;
}
.brand-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.67rem;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    transition: color var(--transition);
    white-space: nowrap;
}
.back-link:hover { color: var(--white); }
.back-link svg { width: 12px; flex-shrink: 0; }
.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(58, 18, 3, 0.85);
    border: 1px solid rgba(196, 92, 26, 0.55);
    border-radius: 50px;
    padding: 4px 13px 4px 4px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.45), 0 1px 0 rgba(255,255,255,0.08) inset, 0 -1px 0 rgba(0,0,0,0.35) inset, 0 0 0 1px rgba(196,92,26,0.2) inset;
    transform: perspective(500px) rotateX(6deg);
    transition: transform 0.3s var(--ease-out), box-shadow 0.3s ease;
}
.brand-badge:hover {
    transform: perspective(500px) rotateX(0deg) translateY(-2px);
}
.brand-badge-dot {
    width: 22px; height: 22px;
    background: linear-gradient(135deg, var(--orange-warm), var(--gold));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.6rem;
    color: var(--white);
    flex-shrink: 0;
}
.brand-badge-text {
    font-size: 0.59rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.9);
    font-weight: 600;
}
.brand-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1.15;
    margin-bottom: 4px;
    white-space: nowrap;
    display: block;
    text-align: center;
}
.brand-title span { color: var(--gold); font-style: italic; }
.brand-sub {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.38);
    letter-spacing: 0.07em;
    text-align: center;
    display: block;
}

/* ── 09. FORM PANEL ── */
.form-panel {
    background: linear-gradient(145deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.03) 50%, rgba(0,0,0,0.1) 100%);
    backdrop-filter: blur(28px) saturate(140%);
    border: 1px solid rgba(212,168,71,0.18);
    border-top-color: rgba(255,255,255,0.15);
    border-left-color: rgba(255,255,255,0.10);
    border-radius: var(--card-radius);
    padding: 20px 26px 18px;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
    animation: fadeSlideUp 0.8s 0.25s var(--ease-out) both;
}
.form-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18) 30%, rgba(212,168,71,0.25) 60%, transparent);
}
.form-panel::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 80px;
    background: linear-gradient(to top, rgba(196,92,26,0.06), transparent);
}
.form-title {
    font-size: 0.62rem;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.42);
    margin-bottom: 14px;
}
.or-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
}
.or-line { flex: 1; height: 1px; background: rgba(255,255,255,0.08); }
.or-text { font-size: 0.67rem; color: rgba(255,255,255,0.28); letter-spacing: 0.1em; }
.form-footer {
    text-align: center;
    margin-top: 12px;
    font-size: 0.73rem;
    color: rgba(255,255,255,0.38);
}
.form-footer a { color: var(--gold); text-decoration: none; font-weight: 500; }
.form-footer a:hover { color: var(--gold-light); }
.form-body { position: relative; overflow: hidden; }
.form-pane { display: none; animation: paneSlideIn 0.35s var(--ease-out); }
.form-pane.active { display: block; }

/* ── 10. AUTH TABS ── */
.auth-tabs {
    display: flex;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 11px;
    padding: 3px;
    margin-bottom: 16px;
    gap: 3px;
}
.tab-btn {
    flex: 1;
    padding: 8px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.4);
    font-family: 'Poppins', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition);
}
.tab-btn.active {
    background: linear-gradient(135deg, var(--brown-rich) 0%, var(--orange-warm) 100%);
    color: var(--white);
    box-shadow: 0 4px 16px rgba(196,92,26,0.45), inset 0 1px 0 rgba(255,255,255,0.15);
}

/* ── 11. INPUTS & LABELS ── */
.input-group-custom { margin-bottom: 10px; }
.input-label {
    display: block;
    font-size: 0.63rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.65);
    margin-bottom: 5px;
}
.input-wrap { position: relative; }
.input-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(212,168,71,0.35);
    pointer-events: none;
}
.input-wrap:focus-within .input-icon { color: var(--gold); }

/* FORM INPUT - SELECT DIPERBAIKI */
.form-input {
    width: 100%;
    background: rgba(255,255,255,0.055);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--input-radius);
    padding: 9px 14px 9px 38px;
    color: var(--white);
    font-family: 'Poppins', sans-serif;
    font-size: 0.84rem;
    outline: none;
    transition: all var(--transition);
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.2);
}

/* SELECT KHUSUS - PERBAIKAN DROPDOWN */
select.form-input {
    -webkit-appearance: none;
    appearance: none;
    background-color: rgba(255,255,255,0.055);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23D4A847' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
    color: var(--white);
}

select.form-input option {
    background-color: #1A0800 !important;
    color: var(--white) !important;
    padding: 10px;
}

select.form-input option:hover {
    background-color: var(--brown-rich) !important;
}

.form-input::placeholder { color: rgba(255,255,255,0.22); }
.form-input:focus {
    border-color: rgba(212,168,71,0.55);
    background: rgba(255,255,255,0.08);
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.2), 0 0 0 3px rgba(212,168,71,0.09);
}

.pwd-toggle {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(212,168,71,0.35);
    cursor: pointer;
}
.pwd-toggle:hover { color: var(--gold); }

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.remember-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.custom-check {
    width: 15px; height: 15px;
    border: 1px solid rgba(212,168,71,0.3);
    border-radius: 4px;
    background: rgba(0,0,0,0.2);
    appearance: none;
    cursor: pointer;
    position: relative;
}
.custom-check:checked {
    background: var(--orange-warm);
    border-color: var(--orange-warm);
}
.custom-check:checked::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.58rem;
    color: var(--white);
}
.remember-label { font-size: 0.72rem; color: rgba(255,255,255,0.55); }
.forgot-link {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
}
.forgot-link:hover { color: var(--white); }

/* CABANG FIELD khusus kasir */
.cabang-field {
    display: none;
    flex-direction: column;
}

/* ── 12. BUTTONS ── */
.btn-masuk {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, var(--orange-warm) 0%, #8B3A0A 100%);
    border: none;
    border-radius: var(--btn-radius);
    color: var(--white);
    font-family: 'Poppins', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
    box-shadow: var(--shadow-btn), inset 0 1px 0 rgba(255,255,255,0.18);
}
.btn-masuk::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3) 50%, transparent);
}
.btn-masuk::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(212,168,71,0.2), transparent 60%);
    opacity: 0;
    transition: opacity var(--transition);
}
.btn-masuk:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-btn-hover), inset 0 1px 0 rgba(255,255,255,0.18);
}
.btn-masuk:hover::after { opacity: 1; }
.btn-masuk:active { transform: translateY(-1px); }
.btn-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}
.btn-masuk.loading .btn-inner { opacity: 0; }
.btn-masuk.loading::after { opacity: 0; }
.btn-masuk.loading {
    background: linear-gradient(135deg, rgba(196,92,26,0.6) 0%, rgba(93,41,6,0.6) 100%);
}
.btn-masuk.loading .spinner {
    display: block;
}
.spinner {
    display: none;
    position: absolute;
    inset: 0;
    margin: auto;
    width: 20px; height: 20px;
    border: 2px solid rgba(255,255,255,0.25);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.65s linear infinite;
}
.social-row { display: flex; }
.btn-social {
    flex: 1;
    padding: 9px 16px;
    background: rgba(255,255,255,0.055);
    border: 1px solid rgba(255,255,255,0.11);
    border-radius: 10px;
    color: rgba(255,255,255,0.55);
    font-family: 'Poppins', sans-serif;
    font-size: 0.76rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    transition: all var(--transition);
}
.btn-social:hover {
    background: rgba(255,255,255,0.09);
    border-color: rgba(255,255,255,0.2);
    color: var(--white);
}
.btn-social svg { width: 15px; height: 15px; }

/* ── 14. TOAST ── */
.toast-wrap {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-90px);
    z-index: 9999;
    transition: transform 0.45s var(--ease-out);
    pointer-events: none;
}
.toast-wrap.show { transform: translateX(-50%) translateY(0); }
.toast-box {
    background: rgba(20, 8, 0, 0.92);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(212,168,71,0.25);
    border-radius: 12px;
    padding: 13px 22px;
    color: var(--white);
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}
.toast-icon { font-size: 1rem; }

/* ── 15. KEYFRAMES ── */
@keyframes batikDrift { 0% { background-position: 0 0, 0 0, 0 0; } 100% { background-position: 300px 520px, -300px 520px, 0 300px; } }
@keyframes orbFloat { 0% { transform: translate(0, 0) scale(1); } 100% { transform: translate(25px, -35px) scale(1.06); } }
@keyframes mandalaRotate { to { transform: rotate(360deg); } }
@keyframes mandalaGlow { 0% { opacity: 0.5; transform: scale(0.92); } 100% { opacity: 1; transform: scale(1.08); } }
@keyframes card3DReveal { 0% { opacity: 0; transform: perspective(1200px) rotateX(20deg) rotateY(-8deg) translateY(60px) scale(0.92); } 100% { opacity: 1; transform: perspective(1200px) rotateX(2deg) rotateY(0deg) translateY(0) scale(1); } }
@keyframes fadeSlideUp { 0% { opacity: 0; transform: translateY(20px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes paneSlideIn { 0% { opacity: 0; transform: translateX(14px); } 100% { opacity: 1; transform: translateX(0); } }
@keyframes particleDrift { 0% { transform: translate(0, 0) scale(1); opacity: 0.25; } 100% { transform: translate(var(--dx,20px), var(--dy,-30px)) scale(1.5); opacity: 0.75; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 16. RESPONSIVE ── */
@media (max-width: 1024px) {
    .mandala { width: 560px; height: 560px; }
    .mandala-ring:nth-child(7) { inset: 260px; }
    .mandala-core { inset: 270px; }
    .brand-title { font-size: 1.9rem; }
    .form-panel { padding: 18px 24px 16px; }
    .orb-1 { width: 450px; height: 450px; }
    .orb-2 { width: 380px; height: 380px; }
    .orb-3 { width: 280px; height: 280px; }
}
@media (max-width: 768px) {
    .page-wrap { height: 100vh; overflow: hidden; align-items: center; padding: 20px 16px; perspective: none; }
    .login-card { transform: none !important; transform-style: flat; animation: fadeSlideUp 0.7s var(--ease-out) both; max-width: 100%; }
    .mandala { width: 340px; height: 340px; }
    .mandala-ring:nth-child(6), .mandala-ring:nth-child(7) { display: none; }
    .mandala-core { inset: 150px; }
    .brand-title { font-size: 1.65rem; }
    .brand-sub { font-size: 0.68rem; }
    .form-panel { padding: 16px 18px 14px; border-radius: 16px; }
    .tab-btn { font-size: 0.76rem; padding: 7px; }
    .form-input { padding: 8px 12px 8px 36px; font-size: 0.82rem; }
    select.form-input { background-size: 12px; }
    .btn-masuk { padding: 9px; font-size: 0.84rem; }
    .orb-1 { width: 260px; height: 260px; top: -80px; right: -60px; }
    .orb-2 { width: 220px; height: 220px; bottom: -60px; left: -50px; }
    .orb-3 { width: 180px; height: 180px; }
    .toast-wrap { top: 12px; max-width: calc(100vw - 32px); }
    .toast-box { white-space: normal; font-size: 0.75rem; padding: 10px 14px; }
}
@media (max-width: 480px) {
    .page-wrap { padding: 16px 14px; }
    .mandala { width: 280px; height: 280px; }
    .mandala-ring:nth-child(5), .mandala-ring:nth-child(6), .mandala-ring:nth-child(7) { display: none; }
    .mandala-core { inset: 120px; }
    .brand-title { font-size: 1.5rem; }
    .form-panel { padding: 14px 14px 12px; border-radius: 14px; }
}
@media (max-width: 360px) {
    .page-wrap { padding: 12px; }
    .brand-title { font-size: 1.35rem; }
    .form-panel { padding: 12px 12px 10px; }
    .tab-btn { font-size: 0.68rem; padding: 6px 4px; }
    .form-input { padding: 7px 10px 7px 32px; font-size: 0.78rem; }
    .btn-masuk { padding: 8px; font-size: 0.8rem; }
    .mandala { width: 240px; height: 240px; }
    .mandala-core { inset: 100px; }
}