/* =============================================
   FarCash — Login Page Stylesheet
   Synced with Dashboard color palette
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Instrument+Serif:ital@0;1&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
    /* ── Dashboard-matched palette ── */
    --sidebar-bg:    #0a1f44;
    --accent:        #60a5fa;
    --accent-2:      #3b82f6;
    --accent-dim:    rgba(59,130,246,0.1);
    --accent-glow:   rgba(59,130,246,0.2);
    --income:        #34d399;
    --surface:       #fffffff5;
    --border:        #dbeafe;
    --border-strong: #bfdbfe;
    --text-primary:  #0a1f44;
    --text-secondary:#3b82f6;
    --text-muted:    #94a3b8;
    --bg:            #0a1f44;
    --shadow-sm:     0 1px 3px rgba(59,130,246,0.06), 0 1px 2px rgba(59,130,246,0.04);
    --shadow-md:     0 4px 16px rgba(59,130,246,0.1), 0 2px 6px rgba(59,130,246,0.06);
    --shadow-lg:     0 20px 60px rgba(10,31,68,0.25), 0 8px 20px rgba(59,130,246,0.08);
    --radius:        16px;
    --radius-sm:     12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    font-size: 16px;
    /* Pastikan html bisa scroll agar konten tidak terpotong */
    overflow-y: auto;
    height: 100%;
}

body {
    min-height: 100vh;
    min-height: 100dvh; /* dynamic viewport for mobile */
    font-family: 'DM Sans', Arial, sans-serif;
    background: var(--bg);
    background-attachment: fixed;
    background-image:
        radial-gradient(ellipse 800px 600px at 80% -10%, rgba(59,130,246,0.18) 0%, transparent 60%),
        radial-gradient(ellipse 600px 400px at -5% 90%, rgba(96,165,250,0.12) 0%, transparent 60%),
        radial-gradient(ellipse 400px 300px at 50% 50%, rgba(59,130,246,0.06) 0%, transparent 60%);
    display: flex;
    align-items: center;
    justify-content: center;
    /* PENTING: overflow harus scroll/auto bukan hidden agar konten tidak terpotong */
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    padding: 24px 16px;
}

/* ── Animated orbs ── */
.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.2;
    pointer-events: none;
    z-index: 0;
}
.bg-orb-1 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, #3b82f6, #1d4ed8);
    top: -150px; left: -150px;
    animation: float1 8s ease-in-out infinite;
}
.bg-orb-2 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, #60a5fa, #3b82f6);
    bottom: -100px; right: -100px;
    animation: float2 10s ease-in-out infinite;
}
.bg-orb-3 {
    width: 200px; height: 200px;
    background: radial-gradient(circle, #93c5fd, #60a5fa);
    top: 40%; left: 60%;
    animation: float3 6s ease-in-out infinite;
}

/* Grid overlay */
.grid-overlay {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(96,165,250,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(96,165,250,0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

@keyframes float1 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(30px,30px)} }
@keyframes float2 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-20px,-25px)} }
@keyframes float3 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-15px,20px)} }

/* ── Login card ── */
.card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 44px 40px;
    box-shadow:
        0 0 0 1px rgba(59,130,246,0.04) inset,
        var(--shadow-lg),
        0 0 80px rgba(59,130,246,0.08);
    animation: slideUp 0.6s cubic-bezier(0.22,1,0.36,1) both;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(32px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Logo ── */
.logo-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 32px;
}

.logo-img-wrap { margin-bottom: 10px; }

.logo-img {
    height: 72px;
    width: auto;
    object-fit: contain;
    border-radius: 16px;
    filter: drop-shadow(0 0 16px rgba(59,130,246,0.3));
}

.tagline {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-top: 4px;
    font-weight: 500;
}

/* ── Divider ── */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
    margin-bottom: 28px;
}

/* ── Greeting ── */
.greeting {
    text-align: center;
    margin-bottom: 24px;
}

.greeting h2 {
    font-family: 'Instrument Serif', 'Times New Roman', serif;
    font-size: 22px;
    font-weight: 400;
    font-style: italic;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.greeting p {
    font-size: 13px;
    color: var(--text-muted);
}

/* ── Error box ── */
.error-box {
    display: none;
    align-items: flex-start;
    gap: 8px;
    background: rgba(248,113,113,0.07);
    border: 1px solid rgba(248,113,113,0.2);
    border-left: 3px solid #f87171;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    color: #dc2626;
    margin-bottom: 20px;
}

/* ── Form ── */
.form-group { margin-bottom: 18px; }

label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.input-wrap { position: relative; }

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    opacity: 0.45;
    pointer-events: none;
}

input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 13px 14px 13px 42px;
    font-size: 14px;
    color: var(--text-primary);
    font-family: 'DM Sans', Arial, sans-serif;
    outline: none;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow-sm);
    /* Prevent iOS zoom on focus (font-size must be >= 16px to avoid zoom) */
    font-size: max(14px, 16px);
    -webkit-appearance: none;
    appearance: none;
}

input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

input:focus {
    border-color: rgba(59,130,246,0.5);
    background: #f0f6ff;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1), var(--shadow-sm);
}

.toggle-pw {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    opacity: 0.35;
    transition: opacity 0.2s;
    background: none;
    border: none;
    padding: 0;
    line-height: 0;
    /* Larger tap target for mobile */
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-pw:hover { opacity: 0.75; }

.forgot { text-align: right; margin-top: 8px; }

.forgot a {
    font-size: 12px;
    color: var(--accent-2);
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.2s;
    font-weight: 500;
    /* Minimum tap target */
    display: inline-block;
    padding: 4px 0;
}

.forgot a:hover { opacity: 1; }

/* ── Login button ── */
.btn-login {
    width: 100%;
    margin-top: 8px;
    padding: 15px;
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    font-family: 'DM Sans', Arial, sans-serif;
    cursor: pointer;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 24px rgba(59,130,246,0.4);
    /* Minimum tap target 44px */
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
}

.btn-login::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent);
    opacity: 0;
    transition: opacity 0.2s;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 32px rgba(59,130,246,0.5);
}

.btn-login:hover::before { opacity: 1; }
.btn-login:active { transform: translateY(0); }

/* ── Register link ── */
.register-link {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: var(--text-muted);
}

.register-link a {
    color: var(--accent-2);
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s;
}

.register-link a:hover { opacity: 0.75; }

/* ── Security badges ── */
.security-badges {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.badge {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ══════════════════════════════════════════════
   MOBILE RESPONSIVE
   ══════════════════════════════════════════════ */

/* Mobile */
@media (max-width: 480px) {
    body {
        padding: 20px 12px;
        padding-top: max(20px, env(safe-area-inset-top));
        padding-bottom: max(20px, env(safe-area-inset-bottom));
        align-items: flex-start;
    }

    .card {
        padding: 32px 24px;
        border-radius: 20px;
        width: 100%;
        max-height: none;
    }

    .logo-img {
        height: 60px;
    }

    .greeting h2 {
        font-size: 20px;
    }

    .greeting p {
        font-size: 12.5px;
    }

    input {
        padding: 13px 14px 13px 42px;
        font-size: 16px; /* Prevent iOS zoom */
    }

    .security-badges {
        gap: 10px;
        margin-top: 20px;
        padding-top: 16px;
    }

    .badge {
        font-size: 10px;
    }
}

/* Very small phones */
@media (max-width: 360px) {
    .card {
        padding: 28px 18px;
    }

    .logo-img {
        height: 52px;
    }

    .security-badges {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
}

/* Landscape mobile - allow scrolling */
@media (max-height: 600px) and (orientation: landscape) {
    body {
        align-items: flex-start;
        padding: 16px;
        overflow-y: auto;
    }

    .card {
        padding: 24px 32px;
    }

    .logo-area {
        margin-bottom: 16px;
        flex-direction: row;
        gap: 12px;
    }

    .logo-img {
        height: 44px;
    }

    .tagline { margin-top: 0; }

    .divider { margin-bottom: 16px; }

    .greeting {
        margin-bottom: 16px;
    }

    .form-group { margin-bottom: 12px; }
}