/* =============================================
   REGISTER.CSS — Register Page  (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:#86efac;
    --success-text:#15803d;
}

body {
    min-height: 100vh;
    background: #eef2f8;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    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.28;
    animation: floatOrb 14s ease-in-out infinite alternate;
}
.orb-1 {
    width: 540px; height: 540px;
    background: radial-gradient(circle, var(--green-main) 0%, transparent 65%);
    top: -160px; right: -120px;
    animation-duration: 17s;
}
.orb-2 {
    width: 420px; height: 420px;
    background: radial-gradient(circle, var(--blue-main) 0%, transparent 65%);
    bottom: -100px; left: -100px;
    animation-duration: 13s;
    animation-delay: -6s;
}
.orb-3 {
    width: 260px; height: 260px;
    background: radial-gradient(circle, var(--sky) 0%, transparent 65%);
    top: 42%; right: 62%;
    animation-duration: 20s;
    animation-delay: -10s;
    opacity: 0.16;
}

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

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;
}

/* ─── Page wrapper ───────────────────────────── */
.page-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.6s cubic-bezier(0.22,1,0.36,1) both;
}

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

/* ─── Register card ──────────────────────────── */
.register-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 14px 44px 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: 560px;
    padding: 2.5rem 2.25rem 2.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    position: relative;
    overflow: hidden;
}

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

/* ─── Card header ────────────────────────────── */
.card-header-area {
    display: flex;
    align-items: center;
    gap: 1.1rem;
}

.hero-logo-wrap {
    width: 60px; height: 60px;
    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 5px rgba(0,86,179,0.06),
        0 5px 16px rgba(0,86,179,0.12);
    padding: 10px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.hero-logo-wrap:hover { transform: scale(1.05); }
.hero-logo { width: 100%; height: 100%; object-fit: contain; }

.card-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.card-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    font-weight: 500;
}

/* ─── Divider ────────────────────────────────── */
.divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,86,179,0.16), rgba(0,166,81,0.1), 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;
}

/* ─── Form ───────────────────────────────────── */
.register-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

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

.field-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-body);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.field-hint {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-pale);
    text-transform: none;
    letter-spacing: 0;
}

.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.72rem 2.6rem;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 0.87rem;
    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;
    appearance: none;
    -webkit-appearance: none;
}

.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; }

/* 1. Ensure the wrapper can contain absolute positioned elements */
.field-wrap {
    position: relative;
    /* Add display: flex or block depending on your existing setup, 
       but position: relative is the important part here. */
}

/* 2. Remove the browser's default arrow and add padding */
select.field-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 2.5rem; /* Make room so text doesn't overlap the new icon */
    cursor: pointer;
    
    /* REMOVE the background-image SVG from your previous CSS if you use this method */
}

/* 3. Position the Bootstrap Icon */
.field-icon-right {
    position: absolute;
    right: 1rem;           /* Distance from the right edge */
    top: 50%;
    transform: translateY(-50%); /* Perfectly center it vertically */
    color: #9ca3af;        /* Match your theme's icon color */
    
    /* CRITICAL: This allows mouse clicks to pass through the icon 
       and open the <select> dropdown beneath it. */
    pointer-events: none; 
}

/* Optional: Change the icon color when the select is focused */
select.field-input:focus ~ .field-icon-right {
    color: #0056b3; 
}

/* Status icon */
.field-status {
    position: absolute;
    right: 0.85rem;
    font-size: 0.88rem;
    pointer-events: none;
    color: var(--text-pale);
}
.field-status.status-ok  { color: #22c55e; }
.field-status.status-err { color: #ef4444; }

/* Password toggle */
.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); }

/* ─── Password strength ──────────────────────── */
.strength-bar {
    height: 5px;
    background: #f0f3f8;
    border-radius: 999px;
    margin-top: 0.4rem;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: transparent;
    transition: width 0.4s cubic-bezier(0.22,1,0.36,1), background 0.4s ease;
}

.strength-label {
    font-size: 0.7rem;
    font-weight: 700;
    margin-top: 0.25rem;
    min-height: 1em;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    transition: color 0.3s;
}

/* ─── Submit button ──────────────────────────── */
.btn-submit {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--blue-main) 0%, var(--blue-mid) 100%);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 0.01em;
    border: none;
    cursor: pointer;
    box-shadow:
        0 2px 4px rgba(0,86,179,0.2),
        0 6px 18px rgba(0,86,179,0.35);
    transition: transform 0.2s cubic-bezier(0.22,1,0.36,1), box-shadow 0.2s ease;
    margin-top: 0.25rem;
    position: relative;
    overflow: hidden;
}

.btn-submit::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.16) 50%, transparent 60%);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

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

.btn-submit: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);
}

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

/* ─── 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); } }

/* ─── Login hint ─────────────────────────────── */
.login-hint {
    font-size: 0.8rem;
    color: var(--text-pale);
    text-align: center;
}

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

.login-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;
}

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

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

/* ─── Responsive ─────────────────────────────── */
@media (max-width: 600px) {
    .register-card {
        padding: 2rem 1.5rem 1.75rem;
        border-radius: 24px;
        max-width: 100%;
    }
    .card-title { font-size: 1.3rem; }
}

@media (max-width: 520px) {
    .field-row { grid-template-columns: 1fr; }
}

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

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