/* ============================================================
   LOCK PAGE — S.N. Subrahmanyan Portal
   Glassmorphism · Geometric Animation · Premium Entrance
   ============================================================ */

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

:root {
    --navy:       #050D1A;
    --navy-mid:   #091527;
    --navy-card:  rgba(10, 20, 42, 0.72);
    --gold:       #C9A84C;
    --gold-light: #E8C97B;
    --gold-dim:   rgba(201, 168, 76, 0.18);
    --steel:      #8B9BAD;
    --white:      #EEF1F8;
    --error:      #E05C5C;
    --success:    #5CC8A0;
    --font-head:  'Cormorant Garamond', serif;
    --font-body:  'Inter', sans-serif;
    --font-mono:  'Space Grotesk', sans-serif;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    font-family: var(--font-body);
    background: var(--navy);
    color: var(--white);
}

/* ── Canvas Background ─────────────────────────────────── */
#bgCanvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* ── Geometric Layer ───────────────────────────────────── */
.geo-layer {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.geo-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(201,168,76,0.08);
    animation: ringPulse 8s ease-in-out infinite;
}
.r1 { width: 600px; height: 600px; top: -200px; right: -200px; animation-delay: 0s; }
.r2 { width: 400px; height: 400px; bottom: -100px; left: -100px; animation-delay: -3s; }
.r3 { width: 300px; height: 300px; top: 50%; left: 50%; transform: translate(-50%,-50%); animation-delay: -5s; }

@keyframes ringPulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.06); }
}
.r3 { animation: ringPulse3 8s ease-in-out infinite; }
@keyframes ringPulse3 {
    0%, 100% { opacity: 0.4; transform: translate(-50%,-50%) scale(1); }
    50% { opacity: 0.8; transform: translate(-50%,-50%) scale(1.06); }
}

.geo-bar {
    position: absolute;
    background: linear-gradient(90deg, transparent, rgba(201,168,76,0.05), transparent);
    height: 1px;
    width: 100%;
    animation: barDrift 6s ease-in-out infinite;
}
.b1 { top: 20%; animation-delay: 0s; }
.b2 { top: 50%; animation-delay: -2s; }
.b3 { top: 80%; animation-delay: -4s; }

@keyframes barDrift {
    0%, 100% { opacity: 0; transform: translateX(-100%); }
    50% { opacity: 1; transform: translateX(100%); }
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(201,168,76,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(201,168,76,0.025) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* ── Lock Wrapper ──────────────────────────────────────── */
.lock-wrapper {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ── Panel Card ────────────────────────────────────────── */
.lock-panel {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: var(--navy-card);
    backdrop-filter: blur(28px) saturate(1.3);
    -webkit-backdrop-filter: blur(28px) saturate(1.3);
    border: 1px solid rgba(201,168,76,0.2);
    border-radius: 4px;
    padding: 52px 48px 44px;
    box-shadow:
        0 0 0 1px rgba(201,168,76,0.05),
        0 24px 80px rgba(0,0,0,0.6),
        inset 0 1px 0 rgba(201,168,76,0.15);
    animation: panelEnter 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
    overflow: hidden;
}

.lock-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0.7;
}

@keyframes panelEnter {
    from { opacity: 0; transform: translateY(30px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Emblem ────────────────────────────────────────────── */
.panel-emblem {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}
.panel-emblem svg {
    width: 64px;
    height: 64px;
    animation: emblemSpin 20s linear infinite;
}
@keyframes emblemSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ── Header ────────────────────────────────────────────── */
.panel-header { text-align: center; margin-bottom: 28px; }

.access-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 3.5px;
    color: var(--gold);
    margin-bottom: 10px;
    opacity: 0.85;
}

.panel-name {
    font-family: var(--font-head);
    font-size: clamp(22px, 4vw, 28px);
    font-weight: 500;
    color: var(--white);
    letter-spacing: 0.5px;
    line-height: 1.2;
    margin-bottom: 8px;
}

.panel-role {
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 400;
    color: var(--steel);
    line-height: 1.6;
    letter-spacing: 0.3px;
}
.panel-role span {
    color: var(--gold);
    font-style: italic;
}

/* ── Divider ───────────────────────────────────────────── */
.panel-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
}
.divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201,168,76,0.3));
}
.divider-line:last-child {
    background: linear-gradient(90deg, rgba(201,168,76,0.3), transparent);
}
.divider-diamond {
    width: 6px; height: 6px;
    border: 1px solid var(--gold);
    transform: rotate(45deg);
    flex-shrink: 0;
    opacity: 0.7;
}

/* ── Form ──────────────────────────────────────────────── */
.panel-form { display: flex; flex-direction: column; gap: 0; }

.form-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 8.5px;
    font-weight: 600;
    letter-spacing: 2.8px;
    color: var(--steel);
    margin-bottom: 10px;
}

.input-shell {
    position: relative;
    margin-bottom: 6px;
}

.code-input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(201,168,76,0.25);
    border-radius: 2px;
    padding: 14px 50px 14px 18px;
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 400;
    color: var(--white);
    letter-spacing: 3px;
    outline: none;
    transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
}
.code-input::placeholder { color: rgba(139,155,173,0.4); letter-spacing: 4px; }
.code-input:focus {
    border-color: rgba(201,168,76,0.6);
    background: rgba(255,255,255,0.07);
    box-shadow: 0 0 0 3px rgba(201,168,76,0.07), inset 0 1px 3px rgba(0,0,0,0.2);
}

.eye-btn {
    position: absolute;
    right: 14px; top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--steel);
    padding: 4px;
    display: flex;
    transition: color 0.2s;
}
.eye-btn:hover { color: var(--gold); }
.eye-btn svg { width: 17px; height: 17px; }

/* ── Error Strip ───────────────────────────────────────── */
.error-strip {
    display: flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font-body);
    font-size: 11.5px;
    color: var(--error);
    padding: 9px 12px;
    background: rgba(224,92,92,0.08);
    border-left: 2px solid var(--error);
    margin-bottom: 20px;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.3s, max-height 0.4s, padding 0.3s, margin 0.3s;
}
.error-strip.visible {
    opacity: 1;
    max-height: 50px;
    padding: 9px 12px;
    margin-bottom: 20px;
}
.error-strip svg { width: 14px; height: 14px; flex-shrink: 0; }

.input-shell.shake {
    animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    15%, 45%, 75% { transform: translateX(-6px); }
    30%, 60%, 90% { transform: translateX(6px); }
}
.input-shell.has-error .code-input {
    border-color: rgba(224,92,92,0.5);
}

/* ── Auth Button ───────────────────────────────────────── */
.auth-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 15px 24px;
    background: linear-gradient(135deg, rgba(201,168,76,0.15) 0%, rgba(201,168,76,0.08) 100%);
    border: 1px solid rgba(201,168,76,0.45);
    border-radius: 2px;
    color: var(--gold-light);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.3s;
    overflow: hidden;
    margin-bottom: 18px;
}
.auth-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(201,168,76,0.25), rgba(201,168,76,0.1));
    opacity: 0;
    transition: opacity 0.3s;
}
.auth-btn:hover::before { opacity: 1; }
.auth-btn:hover {
    border-color: rgba(201,168,76,0.7);
    box-shadow: 0 0 24px rgba(201,168,76,0.12), 0 4px 16px rgba(0,0,0,0.3);
    transform: translateY(-1px);
}
.auth-btn:active { transform: translateY(0); }
.auth-btn-text { position: relative; z-index: 1; }
.auth-btn-arrow { position: relative; z-index: 1; display: flex; }
.auth-btn-arrow svg { width: 18px; height: 14px; }

.access-note {
    text-align: center;
    font-size: 9.5px;
    color: rgba(139,155,173,0.5);
    letter-spacing: 0.5px;
    font-family: var(--font-mono);
}

/* ── Success Layer ─────────────────────────────────────── */
.success-layer {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(5,13,26,0.92);
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s;
    border-radius: 4px;
}
.success-layer.visible {
    opacity: 1;
    pointer-events: auto;
}

.success-checkmark svg { width: 70px; height: 70px; }
.check-circle {
    stroke-dasharray: 201;
    stroke-dashoffset: 201;
    animation: none;
}
.check-path {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: none;
}
.success-layer.visible .check-circle {
    animation: drawCircle 0.6s ease forwards;
}
.success-layer.visible .check-path {
    animation: drawCheck 0.4s ease 0.5s forwards;
}
@keyframes drawCircle {
    to { stroke-dashoffset: 0; }
}
@keyframes drawCheck {
    to { stroke-dashoffset: 0; }
}

.success-title {
    font-family: var(--font-head);
    font-size: 28px;
    font-weight: 400;
    color: var(--gold-light);
    letter-spacing: 1px;
}
.success-sub {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 2.5px;
    color: var(--steel);
    animation: dotPulse 1.2s infinite;
}
@keyframes dotPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ── Footer Credit ─────────────────────────────────────── */
.lock-footer-credit {
    position: fixed;
    bottom: 20px;
    left: 0; right: 0;
    text-align: center;
    font-family: var(--font-body);
    font-size: 10px;
    color: rgba(139,155,173,0.4);
    letter-spacing: 0.5px;
    z-index: 20;
}
.lock-footer-credit a {
    color: rgba(201,168,76,0.5);
    text-decoration: none;
    transition: color 0.2s;
}
.lock-footer-credit a:hover { color: var(--gold); }

/* ── Page Exit Animation ───────────────────────────────── */
body.exit {
    animation: pageExit 0.6s ease forwards;
}
@keyframes pageExit {
    from { opacity: 1; filter: blur(0); }
    to   { opacity: 0; filter: blur(6px); }
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 520px) {
    .lock-panel { padding: 40px 28px 36px; }
    .panel-name { font-size: 22px; }
}
