/* ==========================================================================
   FOREVERLINK SECURE PIN AUTHENTICATION (pin.css)
   ========================================================================== */
:root {
    --bg-void: #060709;
    --bg-card: rgba(18, 20, 28, 0.75);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-gold: rgba(229, 185, 116, 0.35);

    --accent-gold: #e5b974;
    --accent-gold-soft: rgba(229, 185, 116, 0.12);
    --accent-red: #ff4d6d;
    --accent-green: #38ef7d;

    --text-pure: #ffffff;
    --text-secondary: #9aa1b4;
    --text-muted: #5e6475;

    --font-display: 'Syne', -apple-system, sans-serif;
    --font-sans: 'Plus Jakarta Sans', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --ease-snappy: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-fluid: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    background-color: var(--bg-void);
    color: var(--text-pure);
    font-family: var(--font-sans);
    overflow: hidden;
}

.auth-body {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Ambient Radial Lights */
.ambient-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.glow-sphere {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.3;
}

.sphere-primary {
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, var(--accent-gold) 0%, transparent 70%);
}

.sphere-secondary {
    bottom: -15%;
    left: 50%;
    transform: translateX(-50%);
    width: 440px;
    height: 300px;
    background: radial-gradient(circle, rgba(63, 224, 208, 0.2) 0%, transparent 70%);
}

/* Main Terminal Enclave */
.auth-stage {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    height: 100%;
    max-height: 100dvh;
    padding: 1.25rem 1.4rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

/* Header */
.auth-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
}

.back-link {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s var(--ease-snappy);
}

.back-link:hover {
    border-color: var(--accent-gold);
    color: var(--text-pure);
}

.card-chip-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    padding: 0.35rem 0.9rem;
    border-radius: 30px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-gold);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.secure-icon {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Enclave Form Elements */
.auth-enclave {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    text-align: center;
}

.enclave-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
}

.enclave-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* PIN Slots */
.pin-display-group {
    display: flex;
    gap: 0.85rem;
    justify-content: center;
    margin: 0.5rem 0;
}

.pin-box {
    width: 54px;
    height: 64px;
    border-radius: 12px;
    background: rgba(20, 22, 30, 0.85);
    border: 1.5px solid var(--border-subtle);
    color: var(--accent-gold);
    font-family: var(--font-mono);
    font-size: 1.8rem;
    text-align: center;
    outline: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    transition: all 0.2s var(--ease-snappy);
}

.pin-box:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 20px rgba(229, 185, 116, 0.35);
    transform: translateY(-2px);
    background: rgba(28, 32, 44, 0.95);
}

.pin-box.filled {
    border-color: rgba(229, 185, 116, 0.6);
}

/* Feedback Label */
.status-feedback {
    font-size: 0.8rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    min-height: 1.2rem;
    transition: color 0.2s ease;
}

.status-feedback.error {
    color: var(--accent-red);
}

.status-feedback.success {
    color: var(--accent-green);
}

/* Decrypt Button */
.decrypt-btn {
    width: 100%;
    padding: 0.95rem 1.4rem;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent-gold) 0%, #b88628 100%);
    border: none;
    color: #0b0c10;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    box-shadow: 0 8px 25px rgba(229, 185, 116, 0.3);
    transition: all 0.2s var(--ease-snappy);
}

.decrypt-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(229, 185, 116, 0.5);
}

.decrypt-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Tactile Numeric Keypad */
.numpad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
    width: 100%;
    max-width: 320px;
    padding-bottom: 0.5rem;
}

.num-key {
    background: rgba(18, 20, 28, 0.7);
    border: 1px solid var(--border-subtle);
    color: var(--text-pure);
    font-family: var(--font-mono);
    font-size: 1.35rem;
    font-weight: 500;
    height: 52px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.1s ease;
}

.num-key:active {
    background: rgba(229, 185, 116, 0.2);
    transform: scale(0.96);
}

.num-key.action-key {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Shake Animation on Wrong PIN */
.shake {
    animation: shakeEffect 0.45s ease-in-out;
}

@keyframes shakeEffect {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

/* Footer */
.auth-footer {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

/* Decryption Curtain */
.auth-curtain {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: radial-gradient(circle at center, #0e1017 0%, #060709 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s var(--ease-fluid);
}

.auth-curtain.active {
    opacity: 1;
    visibility: visible;
}

.curtain-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}

.pulse-ring {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--accent-gold-soft);
    border-top-color: var(--accent-gold);
    animation: spin 0.8s linear infinite;
}

.curtain-text {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-gold);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

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

@media (max-height: 680px) {
    .enclave-title { font-size: 1.35rem; }
    .pin-box { width: 48px; height: 56px; font-size: 1.5rem; }
    .num-key { height: 44px; font-size: 1.2rem; }
    .auth-stage { padding: 0.8rem 1.2rem; }
}