/* ============================================================
   ZENITHPOS - Auth Pages (auth.css)
   Font: Inter (loaded via Google Fonts)
   Theme: Dark Purple + Pink-Magenta (soft)
   ============================================================ */

/* ============================================================
   1. ANIMATED BACKGROUND
   ============================================================ */

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-6);
    position: relative;
    overflow: hidden;
    /* Dark purple background — mirip referensi */
    background: linear-gradient(135deg, #1a0a2e 0%, #2d1045 35%, #3b1460 60%, #1a0a2e 100%);
    font-family: 'Inter', sans-serif;
}

/* ---- Ambient glow blobs ---- */
.auth-wrapper::before,
.auth-wrapper::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}

/* Kiri-atas: biru-ungu */
.auth-wrapper::before {
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(80,30,160,0.45) 0%, rgba(50,10,120,0.25) 45%, transparent 70%);
    top: -250px;
    left: -250px;
    animation: floatBlob 14s ease-in-out infinite alternate;
}

/* Kanan-bawah: pink-magenta */
.auth-wrapper::after {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(200,50,130,0.30) 0%, rgba(160,20,100,0.15) 50%, transparent 70%);
    bottom: -200px;
    right: -200px;
    animation: floatBlob 11s ease-in-out infinite alternate-reverse;
}

@keyframes floatBlob {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(30px, 20px) scale(1.06); }
    100% { transform: translate(-15px, 35px) scale(0.96); }
}

/* ---- Diagonal line accents (seperti di referensi) ---- */
.auth-line-deco {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.auth-line-deco::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 1.5px;
    background: linear-gradient(90deg, transparent, rgba(200,80,160,0.25), rgba(120,50,200,0.20), transparent);
    top: 38%;
    left: -50%;
    transform: rotate(-8deg);
}

.auth-line-deco::after {
    content: '';
    position: absolute;
    width: 200%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(160,50,210,0.18), rgba(200,80,140,0.20), transparent);
    top: 55%;
    left: -50%;
    transform: rotate(-8deg);
}

/* ---- Particle dots ---- */
.auth-particles {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.auth-particles span {
    position: absolute;
    display: block;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    animation: twinkle 4s ease-in-out infinite;
}

.auth-particles span:nth-child(1)  { top: 10%; left: 15%; animation-delay: 0s; }
.auth-particles span:nth-child(2)  { top: 25%; left: 70%; animation-delay: 0.5s; }
.auth-particles span:nth-child(3)  { top: 60%; left: 30%; animation-delay: 1s; }
.auth-particles span:nth-child(4)  { top: 75%; left: 80%; animation-delay: 1.5s; }
.auth-particles span:nth-child(5)  { top: 40%; left: 50%; animation-delay: 2s; }
.auth-particles span:nth-child(6)  { top: 85%; left: 20%; animation-delay: 2.5s; }
.auth-particles span:nth-child(7)  { top: 15%; left: 85%; animation-delay: 3s; }
.auth-particles span:nth-child(8)  { top: 50%; left: 10%; animation-delay: 0.8s; }
.auth-particles span:nth-child(9)  { top: 35%; left: 90%; animation-delay: 1.8s; }
.auth-particles span:nth-child(10) { top: 90%; left: 55%; animation-delay: 3.5s; }

@keyframes twinkle {
    0%, 100% { opacity: 0.15; transform: scale(1); }
    50%       { opacity: 0.9;  transform: scale(2.5); }
}

/* ---- POS-themed decorative background icons ---- */
.auth-bg-deco {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-deco {
    position: absolute;
    color: rgba(200, 100, 180, 0.10);
    animation: decoFloat 10s ease-in-out infinite alternate;
}

.bg-deco--1 { width: 90px;  top: 6%;   left: 4%;  animation-delay: 0s;   animation-duration: 12s; transform: rotate(-12deg); }
.bg-deco--2 { width: 60px;  top: 12%;  right: 6%; animation-delay: -2s;  animation-duration: 9s;  transform: rotate(8deg); }
.bg-deco--3 { width: 100px; bottom: 18%; left: 3%; animation-delay: -4s; animation-duration: 14s; transform: rotate(6deg); color: rgba(180,100,220,0.09); }
.bg-deco--4 { width: 80px;  bottom: 8%; right: 5%; animation-delay: -1s; animation-duration: 11s; transform: rotate(-5deg); color: rgba(220,120,180,0.09); }
.bg-deco--5 { width: 70px;  top: 45%;  left: 2%;  animation-delay: -3s;  animation-duration: 13s; transform: rotate(15deg); color: rgba(200,80,160,0.10); }
.bg-deco--6 { width: 110px; top: 72%;  right: 3%; animation-delay: -5s;  animation-duration: 10s; transform: rotate(-8deg); color: rgba(160,60,200,0.09); }
.bg-deco--7 { width: 80px;  top: 3%;   left: 50%; animation-delay: -6s;  animation-duration: 15s; transform: translateX(-50%) rotate(5deg); color: rgba(200,100,180,0.10); }
.bg-deco--8 { width: 75px;  bottom: 4%; left: 30%; animation-delay: -7s; animation-duration: 11s; transform: rotate(-10deg); color: rgba(180,80,200,0.09); }

@keyframes decoFloat {
    0%   { transform: translateY(0px)   rotate(var(--r, 0deg)) scale(1); }
    33%  { transform: translateY(-14px) rotate(var(--r, 0deg)) scale(1.04); }
    66%  { transform: translateY(8px)   rotate(var(--r, 0deg)) scale(0.97); }
    100% { transform: translateY(-6px)  rotate(var(--r, 0deg)) scale(1.02); }
}

/* ============================================================
   2. AUTH CARD (Panel)
   ============================================================ */

.auth-panel {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;

    /* Glassmorphism — kartu gelap seperti referensi */
    background: rgba(20, 8, 40, 0.72);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 24px;
    padding: 2.5rem 2.25rem 2.25rem;
    box-shadow:
        0 32px 80px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255,255,255,0.04),
        inset 0 1px 0 rgba(255,255,255,0.08);

    animation: cardEntrance 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes cardEntrance {
    0%   { opacity: 0; transform: translateY(40px) scale(0.96); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-form-container {
    width: 100%;
}

/* ============================================================
   3. LOGO SECTION
   ============================================================ */

.auth-card-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.75rem;
    animation: fadeInDown 0.5s ease 0.2s both;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-card-logo .logo-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    position: relative;
}

.auth-card-logo .logo-icon svg {
    width: 80px;
    height: 80px;
    position: relative;
    z-index: 1;
}

/* === ANIMASI LOGO === */

/* 1. Keseluruhan SVG: float naik-turun halus */
.logo-svg {
    animation: logoFloat 3.6s ease-in-out infinite;
    filter: drop-shadow(0 6px 20px rgba(160, 40, 100, 0.40));
}

@keyframes logoFloat {
    0%   { transform: translateY(0px);   filter: drop-shadow(0 6px 20px rgba(160,40,100,0.38)); }
    35%  { transform: translateY(-7px);  filter: drop-shadow(0 14px 28px rgba(180,50,120,0.52)); }
    65%  { transform: translateY(-4px);  filter: drop-shadow(0 10px 24px rgba(170,45,110,0.46)); }
    100% { transform: translateY(0px);   filter: drop-shadow(0 6px 20px rgba(160,40,100,0.38)); }
}

/* 2. Kotak background: glow pulse + sedikit scale breathe */
.logo-bg-rect {
    transform-origin: 40px 40px;
    animation: logoBgPulse 3.6s ease-in-out infinite;
}

@keyframes logoBgPulse {
    0%   { opacity: 0.82; }
    35%  { opacity: 0.95; }
    70%  { opacity: 0.86; }
    100% { opacity: 0.82; }
}

/* 3. Ikon dompet: sedikit wobble kiri-kanan */
.logo-wallet-body {
    transform-origin: 40px 43px;
    animation: walletWobble 3.6s ease-in-out infinite;
}

.logo-wallet-flap {
    animation: flapFade 3.6s ease-in-out infinite;
}

@keyframes walletWobble {
    0%   { transform: rotate(0deg)    scaleX(1); }
    20%  { transform: rotate(-1.5deg) scaleX(0.99); }
    50%  { transform: rotate(1.5deg)  scaleX(1.01); }
    80%  { transform: rotate(-0.8deg) scaleX(0.995); }
    100% { transform: rotate(0deg)    scaleX(1); }
}

@keyframes flapFade {
    0%, 100% { opacity: 0.70; }
    45%      { opacity: 0.90; }
}

/* 4. Badge Rp: bounce kecil, offset sedikit dari float SVG */
.logo-badge {
    transform-origin: 58px 22px;
    animation: badgeBounce 3.6s ease-in-out infinite;
}

@keyframes badgeBounce {
    0%   { transform: scale(1)    translateY(0px); }
    18%  { transform: scale(1.12) translateY(-3px); }
    36%  { transform: scale(0.94) translateY(1px); }
    52%  { transform: scale(1.06) translateY(-2px); }
    70%  { transform: scale(0.97) translateY(0.5px); }
    100% { transform: scale(1)    translateY(0px); }
}

/* Heading "Selamat Datang" */
.auth-card-logo .brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.03em;
    line-height: 1.2;
    font-family: 'Inter', sans-serif;
}

/* Subtitle */
.auth-card-logo .brand-sub {
    font-size: 0.825rem;
    color: rgba(255, 255, 255, 0.50);
    font-weight: 400;
    letter-spacing: 0.01em;
    margin-top: 0.3rem;
    font-family: 'Inter', sans-serif;
    text-transform: none;
}

/* ============================================================
   4. AUTH HEADER  (disembunyikan — heading ada di logo section)
   ============================================================ */

.auth-header {
    display: none;
}

/* ============================================================
   5. FORM ELEMENTS
   ============================================================ */

.form-group {
    margin-bottom: 1.125rem;
    animation: fadeInUp 0.5s ease 0.4s both;
}

.form-group + .form-group {
    animation-delay: 0.45s;
}

/* Label */
.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.70);
    margin-bottom: 0.45rem;
    letter-spacing: 0.01em;
    font-family: 'Inter', sans-serif;
}

.form-label .required {
    color: #f87171;
    margin-left: 2px;
}

/* Input wrapper */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 0.875rem;
    color: rgba(255, 255, 255, 0.30);
    pointer-events: none;
    display: flex;
    align-items: center;
    transition: color 200ms ease;
    z-index: 1;
}

.input-icon svg {
    width: 16px;
    height: 16px;
}

/* Input */
.form-control {
    width: 100%;
    height: 48px;
    padding: 0 1rem;
    font-size: 0.875rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.90);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 10px;
    outline: none;
    transition: all 200ms ease;
    -webkit-appearance: none;
    appearance: none;
    font-family: 'Inter', sans-serif;
    caret-color: #e879b0;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.22);
    font-weight: 400;
}

.form-control.has-icon-left {
    padding-left: calc(0.875rem + 16px + 0.6rem);
}

.form-control.has-icon-right {
    padding-right: calc(0.875rem + 16px + 0.6rem);
}

/* Hover */
.form-control:hover {
    border-color: rgba(255, 255, 255, 0.20);
    background: rgba(255, 255, 255, 0.09);
}

/* Focus */
.form-control:focus {
    border-color: rgba(220, 80, 160, 0.55);
    background: rgba(180, 40, 120, 0.10);
    box-shadow:
        0 0 0 3px rgba(200, 60, 140, 0.18),
        0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Focus icon color */
.input-wrapper:focus-within .input-icon {
    color: rgba(230, 120, 180, 0.80);
}

/* Invalid */
.form-control.is-invalid {
    border-color: #f87171;
    background: rgba(248, 113, 113, 0.08);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.2);
}

/* Password toggle */
.btn-password-toggle {
    position: absolute;
    right: 0.875rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    transition: color 150ms ease;
    border-radius: 6px;
    z-index: 1;
}

.btn-password-toggle svg {
    width: 16px;
    height: 16px;
}

.btn-password-toggle:hover {
    color: rgba(230, 120, 180, 0.90);
}

/* Error message */
.form-error {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.4rem;
    font-size: 0.775rem;
    color: #fca5a5;
    font-weight: 500;
    min-height: 16px;
    font-family: 'Inter', sans-serif;
}

.form-error svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

/* ============================================================
   6. REMEMBER ME + FORGOT PASSWORD
   ============================================================ */

.form-row-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.375rem;
    animation: fadeInUp 0.5s ease 0.5s both;
}

/* Checkbox */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.form-check-input {
    width: 16px;
    height: 16px;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    position: relative;
    transition: all 150ms ease;
    flex-shrink: 0;
}

.form-check-input:checked {
    background: linear-gradient(135deg, #b03080, #e0508a);
    border-color: #e879b0;
}

.form-check-input:checked::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 4px;
    width: 5px;
    height: 9px;
    border: 2px solid white;
    border-top: none;
    border-left: none;
    transform: rotate(40deg);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(200, 60, 140, 0.22);
    outline: none;
}

.form-check-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1;
    cursor: pointer;
    user-select: none;
    font-family: 'Inter', sans-serif;
}

/* Forgot link — dihilangkan sesuai referensi (tidak ada forgot di gambar) */
.forgot-link {
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.40);
    text-decoration: none;
    transition: color 150ms ease;
    font-family: 'Inter', sans-serif;
    position: relative;
}

.forgot-link::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 1px;
    background: rgba(230, 120, 180, 0.70);
    transition: width 200ms ease;
}

.forgot-link:hover {
    color: rgba(230, 120, 180, 0.90);
}

.forgot-link:hover::after {
    width: 100%;
}

/* ============================================================
   7. SUBMIT BUTTON
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0 1.75rem;
    height: 48px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 12px;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all 200ms ease;
    white-space: nowrap;
    text-decoration: none;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    letter-spacing: 0.02em;
    font-family: 'Inter', sans-serif;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.5s ease 0.55s both;
}

/* Shimmer effect */
.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.18),
        transparent
    );
    transition: left 400ms ease;
}

.btn-primary:hover::before {
    left: 100%;
}

/* Tombol utama: gradient pink-magenta seperti referensi */
.btn-primary {
    background: linear-gradient(135deg, #b03070 0%, #d4407a 45%, #e8608a 100%);
    background-size: 200% 200%;
    color: white;
    border-color: transparent;
    box-shadow:
        0 4px 20px rgba(180, 50, 110, 0.50),
        0 1px 3px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.5s ease 0.55s both, gradientShift 4s ease infinite;
}

@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 32px rgba(200, 60, 130, 0.60),
        0 2px 8px rgba(0, 0, 0, 0.3);
    color: white;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(180, 50, 110, 0.45);
}

.btn-primary:disabled,
.btn-primary.loading {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-lg {
    height: 50px;
    font-size: 0.95rem;
    padding: 0 2rem;
    border-radius: 14px;
}

.btn-block {
    width: 100%;
}

/* Button spinner */
.btn .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.65s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   8. ALERT / FLASH MESSAGE
   ============================================================ */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    border: 1px solid transparent;
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
    animation: slideDown 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    font-family: 'Inter', sans-serif;
    backdrop-filter: blur(8px);
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.alert__icon { flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px; }
.alert__icon svg { width: 20px; height: 20px; }
.alert__content { flex: 1; }
.alert__title { font-weight: 600; margin-bottom: 2px; }
.alert__message { line-height: 1.6; opacity: 0.88; }

.alert-danger  { background: rgba(248,113,113,0.12); border-color: rgba(248,113,113,0.3);  color: #fca5a5; }
.alert-success { background: rgba(52,211,153,0.12);  border-color: rgba(52,211,153,0.3);   color: #6ee7b7; }
.alert-warning { background: rgba(251,191,36,0.12);  border-color: rgba(251,191,36,0.3);   color: #fcd34d; }
.alert-info    { background: rgba(96,165,250,0.12);  border-color: rgba(96,165,250,0.3);   color: #93c5fd; }

/* ============================================================
   9. DIVIDER
   ============================================================ */

.divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.divider__line {
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.divider__text {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.30);
    white-space: nowrap;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: 'Inter', sans-serif;
}

/* ============================================================
   10. FOOTER LINKS
   ============================================================ */

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.825rem;
    color: rgba(255, 255, 255, 0.35);
    animation: fadeInUp 0.5s ease 0.65s both;
    font-family: 'Inter', sans-serif;
}

.auth-footer a {
    font-weight: 600;
    color: rgba(230, 120, 180, 0.80);
    text-decoration: none;
    transition: color 150ms ease;
}

.auth-footer a:hover {
    color: rgba(240, 150, 200, 0.95);
    text-decoration: underline;
}

/* Copyright footer */
.auth-simple-footer {
    margin-top: 1.75rem;
    color: rgba(255, 255, 255, 0.20);
    font-size: 0.75rem;
    position: relative;
    z-index: 1;
    text-align: center;
    animation: fadeInUp 0.5s ease 0.7s both;
    font-family: 'Inter', sans-serif;
}

/* ============================================================
   11. LOADING OVERLAY
   ============================================================ */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 5, 40, 0.88);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    gap: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 250ms ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.loading-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255, 255, 255, 0.10);
    border-top-color: #e0508a;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.55);
    font-family: 'Inter', sans-serif;
}

/* ============================================================
   12. RESPONSIVE
   ============================================================ */

@media (max-width: 480px) {
    .auth-wrapper {
        padding: 1rem;
        justify-content: flex-start;
        padding-top: 2.5rem;
    }

    .auth-panel {
        padding: 2rem 1.5rem;
        border-radius: 20px;
        max-width: 100%;
    }

    .auth-card-logo .brand-name {
        font-size: 1.3rem;
    }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
