/* =============================================
   INDEX.CSS — Landing + Inline Login  (Enhanced)
   Gardu BKK K1 Cilacap
   ============================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

@font-face {
    font-family: 'Plus Jakarta Sans';
    src: url('../fonts/PlusJakartaSans-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Plus Jakarta Sans';
    src: url('../fonts/PlusJakartaSans-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'Plus Jakarta Sans';
    src: url('../fonts/PlusJakartaSans-Italic.ttf') format('truetype');
    font-weight: 400;
    font-style: italic;
}

:root {
    --blue-deep:   #003d82;
    --blue-main:   #0056b3;
    --blue-mid:    #0070e0;
    --blue-light:  #e8f0fb;
    --green-main:  #00a651;
    --green-light: #f0fdf4;
    --sky:         #38bdf8;
    --text-dark:   #0f1e35;
    --text-body:   #374151;
    --text-muted:  #6b7a8d;
    --text-pale:   #9ca3af;
    --border:      #e2e8f0;
    --surface:     rgba(255,255,255,0.88);
    --error-bg:    #fff1f1;
    --error-border:#fca5a5;
    --error-text:  #b91c1c;
    --success-bg:  #f0fdf4;
    --success-border:#bbf7d0;
    --success-text:#15803d;
}

body {
    min-height: 100vh;
    background: #eef2f8;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

/* ─── Background ─────────────────────────────── */
.bg-orbs { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.3;
    animation: floatOrb 14s ease-in-out infinite alternate;
}
.orb-1 {
    width: 560px; height: 560px;
    background: radial-gradient(circle, var(--blue-main) 0%, transparent 65%);
    top: -160px; left: -120px;
    animation-duration: 16s;
}
.orb-2 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, var(--green-main) 0%, transparent 65%);
    bottom: -100px; right: -100px;
    animation-duration: 13s;
    animation-delay: -5s;
}
.orb-3 {
    width: 280px; height: 280px;
    background: radial-gradient(circle, var(--sky) 0%, transparent 65%);
    top: 50%; left: 58%;
    animation-duration: 18s;
    animation-delay: -9s;
    opacity: 0.18;
}

@keyframes floatOrb {
    0%   { transform: translate(0,0) scale(1); }
    50%  { transform: translate(28px,-18px) scale(1.06); }
    100% { transform: translate(-18px,28px) scale(0.96); }
}

/* Subtle grid texture overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(rgba(0,86,179,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,86,179,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

/* ─── Wrapper ────────────────────────────────── */
.landing-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.25rem;
    gap: 1.5rem;
    animation: fadeUp 0.65s cubic-bezier(0.22,1,0.36,1) both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(32px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Hero card ──────────────────────────────── */
.hero-card {
    background: var(--surface);
    backdrop-filter: blur(24px) saturate(1.6);
    -webkit-backdrop-filter: blur(24px) saturate(1.6);
    border: 1px solid rgba(255,255,255,0.95);
    border-radius: 28px;
    box-shadow:
        0 0 0 1px rgba(0,86,179,0.06),
        0 4px 6px rgba(0,0,0,0.04),
        0 12px 40px rgba(0,86,179,0.10),
        0 40px 80px rgba(0,86,179,0.06),
        inset 0 1px 0 rgba(255,255,255,0.9);
    width: 100%;
    max-width: 460px;
    padding: 2.75rem 2.25rem 2.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.35rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Card top accent line */
.hero-card::before {
    content: '';
    position: absolute;
    top: 0; left: 10%; right: 10%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--blue-main), var(--green-main), transparent);
    border-radius: 0 0 4px 4px;
}

/* ─── Logo ───────────────────────────────────── */
.hero-logo-wrap {
    width: 92px; height: 92px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--blue-light) 0%, #f0faf5 100%);
    border: 2px solid rgba(0,86,179,0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 0 6px rgba(0,86,179,0.06),
        0 6px 20px rgba(0,86,179,0.14);
    padding: 13px;
    flex-shrink: 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-logo-wrap:hover {
    transform: scale(1.04);
    box-shadow:
        0 0 0 8px rgba(0,86,179,0.09),
        0 8px 28px rgba(0,86,179,0.18);
}

.hero-logo { width: 100%; height: 100%; object-fit: contain; }

/* ─── Text ───────────────────────────────────── */
.hero-text { display: flex; flex-direction: column; gap: 0.5rem; }

.hero-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--text-dark);
    letter-spacing: -0.03em;
}

.text-gradient {
    background: linear-gradient(135deg, var(--blue-main) 0%, var(--blue-mid) 50%, var(--green-main) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 0.83rem;
    color: var(--text-muted);
    line-height: 1.55;
    max-width: 320px;
    margin: 0 auto;
}

/* ─── Divider ────────────────────────────────── */
.divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,86,179,0.18), rgba(0,166,81,0.12), transparent);
}

/* ─── Alerts ─────────────────────────────────── */
.auth-alert {
    display: none;
    width: 100%;
    padding: 0.7rem 1rem;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 500;
    text-align: left;
    line-height: 1.5;
    gap: 0.5rem;
    align-items: flex-start;
    animation: slideDown 0.25s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-alert.visible { display: flex; }

.auth-alert--error {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error-text);
}

.auth-alert--success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success-text);
}

.auth-alert i {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ─── Login form ─────────────────────────────── */
.login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.field-group { display: flex; flex-direction: column; gap: 0.4rem; text-align: left; }

.field-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-body);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.field-wrap { position: relative; display: flex; align-items: center; }

.field-icon {
    position: absolute;
    left: 0.9rem;
    color: var(--text-pale);
    font-size: 0.95rem;
    pointer-events: none;
    transition: color 0.2s;
}

.field-wrap:focus-within .field-icon { color: var(--blue-main); }

.field-input {
    width: 100%;
    padding: 0.78rem 2.85rem;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 0.88rem;
    font-family: inherit;
    color: var(--text-dark);
    background: rgba(255,255,255,0.7);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.field-input::placeholder { color: #c8d0dc; }

.field-input:focus {
    border-color: var(--blue-main);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(0,86,179,0.09);
}

.field-input:hover:not(:focus) { border-color: #c0cfe0; }

.toggle-pw {
    position: absolute;
    right: 0.8rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-pale);
    font-size: 1rem;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.15s;
    border-radius: 6px;
}
.toggle-pw:hover { color: var(--blue-main); }

/* ─── Buttons ────────────────────────────────── */
.btn-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.82rem 1.5rem;
    border-radius: 14px;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    border: none;
    font-family: inherit;
    letter-spacing: 0.01em;
    transition: transform 0.2s cubic-bezier(0.22,1,0.36,1), box-shadow 0.2s ease;
}

.btn-cta-primary {
    background: linear-gradient(135deg, var(--blue-main) 0%, var(--blue-mid) 100%);
    color: #fff;
    box-shadow:
        0 2px 4px rgba(0,86,179,0.2),
        0 6px 18px rgba(0,86,179,0.35);
    position: relative;
    overflow: hidden;
}

/* Shimmer effect on hover */
.btn-cta-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.18) 50%, transparent 60%);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.btn-cta-primary:hover:not(:disabled)::after { transform: translateX(100%); }

.btn-cta-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow:
        0 4px 6px rgba(0,86,179,0.18),
        0 10px 28px rgba(0,86,179,0.42);
    color: #fff;
}

.btn-cta-primary:active:not(:disabled) { transform: translateY(0); }
.btn-cta-primary:disabled { opacity: 0.68; cursor: not-allowed; }

.btn-submit { width: 100%; margin-top: 0.15rem; }

/* ─── Spinner ────────────────────────────────── */
.spinner {
    display: none;
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.65s linear infinite;
    flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Forgot password link ───────────────────── */
#btnForgotPassword {
    transition: color 0.2s ease;
    text-decoration: none;
    color: var(--text-muted);
}
#btnForgotPassword:hover {
    color: var(--blue-mid);
    text-decoration: underline;
}

/* ─── Register hint ──────────────────────────── */
.register-hint {
    font-size: 0.8rem;
    color: var(--text-pale);
}

.register-link {
    color: var(--blue-main);
    font-weight: 700;
    text-decoration: none;
    position: relative;
}

.register-link::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0; right: 0;
    height: 1.5px;
    background: var(--blue-main);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.25s ease;
}

.register-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* ─── Footer ─────────────────────────────────── */
.landing-footer {
    font-size: 0.72rem;
    color: #9aa5b4;
    text-align: center;
    letter-spacing: 0.04em;
}

/* ─── Responsive ─────────────────────────────── */
@media (max-width: 520px) {
    .hero-card {
        padding: 2.25rem 1.5rem 1.75rem;
        border-radius: 24px;
        max-width: 100%;
    }
    .hero-title { font-size: 1.7rem; }
    .hero-logo-wrap { width: 80px; height: 80px; }
}

@media (max-width: 380px) {
    .hero-card { padding: 1.75rem 1.25rem; border-radius: 20px; }
    .hero-title { font-size: 1.5rem; }
    .field-input { font-size: 0.84rem; }
}

/* High-resolution displays */
@media (min-width: 1200px) {
    .hero-card { max-width: 480px; }
}