/* =========================================================
   SACRED ACCESS PORTAL - Passcode Gate
   ========================================================= */

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

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
    color: #faf6ee;
    -webkit-font-smoothing: antialiased;
}

.gate-stage {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gate-bg {
    position: absolute;
    inset: 0;
    background-image: url('../images/Bhabani-mata-temple-top-1933291.png');
    background-size: cover;
    background-position: center;
    transform: scale(1.08);
    animation: gateZoom 28s ease-in-out infinite alternate;
    z-index: 0;
}

@keyframes gateZoom {
    from { transform: scale(1.04); }
    to   { transform: scale(1.14); }
}

.gate-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at center, rgba(15,22,38,0.6) 0%, rgba(15,22,38,0.92) 80%),
        linear-gradient(135deg, rgba(90,26,26,0.4), rgba(15,22,38,0.7));
    z-index: 1;
}

.gate-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(2px 2px at 20% 30%, rgba(201,161,74,0.4), transparent),
        radial-gradient(1.5px 1.5px at 70% 80%, rgba(201,161,74,0.3), transparent),
        radial-gradient(1.5px 1.5px at 40% 60%, rgba(201,161,74,0.25), transparent),
        radial-gradient(2px 2px at 85% 25%, rgba(201,161,74,0.35), transparent);
    background-size: 250px 250px;
    opacity: 0.6;
}

.gate-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 540px;
    padding: 3rem 2rem;
    animation: gateRise 1.4s cubic-bezier(.2,.8,.3,1) both;
}

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

.gate-emblem {
    text-align: center;
    margin-bottom: 2.4rem;
}

.gate-emblem-mark {
    width: 88px;
    height: 88px;
    margin: 0 auto 1.4rem;
    border: 1.5px solid #c9a14a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e0bd5e;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 2rem;
    position: relative;
    background: rgba(15,22,38,0.4);
    backdrop-filter: blur(6px);
}

.gate-emblem-mark::before {
    content: "";
    position: absolute;
    inset: 6px;
    border: 1px solid #c9a14a;
    border-radius: 50%;
    opacity: 0.5;
}

.gate-emblem-mark::after {
    content: "";
    position: absolute;
    inset: -10px;
    border: 1px solid rgba(201,161,74,0.18);
    border-radius: 50%;
    animation: emblemPulse 4s ease-in-out infinite;
}

@keyframes emblemPulse {
    0%, 100% { transform: scale(1); opacity: 0.18; }
    50%      { transform: scale(1.12); opacity: 0.4; }
}

.gate-name {
    font-family: "Cinzel", "Cormorant Garamond", serif;
    font-size: 0.78rem;
    letter-spacing: 0.42em;
    text-transform: uppercase;
    color: #e0bd5e;
    margin-bottom: 0.6rem;
    font-weight: 500;
}

.gate-title {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 400;
    color: #faf6ee;
    line-height: 1.2;
    letter-spacing: 0.01em;
}

.gate-title em {
    color: #e0bd5e;
    font-style: italic;
}

.gate-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1.4rem 0 2rem;
    color: #c9a14a;
    font-size: 0.85rem;
    letter-spacing: 1.2em;
}

.gate-divider::before,
.gate-divider::after {
    content: "";
    width: 50px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #c9a14a, transparent);
    margin: 0 1rem;
}

.gate-card {
    background: rgba(20, 28, 46, 0.55);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(201,161,74,0.35);
    padding: 2.6rem 2.4rem 2.4rem;
    box-shadow: 0 30px 80px rgba(0,0,0,0.5);
    position: relative;
}

.gate-card::before {
    content: "";
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(201,161,74,0.18);
    pointer-events: none;
}

.gate-card-eyebrow {
    font-family: "Cinzel", serif;
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #c9a14a;
    text-align: center;
    margin-bottom: 0.6rem;
    font-weight: 600;
}

.gate-card h2 {
    font-family: "Cormorant Garamond", serif;
    font-size: 1.5rem;
    font-weight: 500;
    color: #faf6ee;
    text-align: center;
    margin-bottom: 0.4rem;
}

.gate-card-sub {
    text-align: center;
    color: rgba(250,246,238,0.65);
    font-size: 0.92rem;
    margin-bottom: 1.8rem;
}

.gate-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.gate-input-wrap {
    position: relative;
}

.gate-input {
    width: 100%;
    padding: 1.05rem 1.2rem;
    background: rgba(15,22,38,0.55);
    border: 1px solid rgba(201,161,74,0.4);
    color: #faf6ee;
    font-family: "Inter", sans-serif;
    font-size: 1rem;
    letter-spacing: 0.4em;
    text-align: center;
    transition: 0.3s;
    border-radius: 2px;
}

.gate-input::placeholder {
    color: rgba(250,246,238,0.4);
    letter-spacing: 0.18em;
}

.gate-input:focus {
    outline: none;
    border-color: #c9a14a;
    background: rgba(15,22,38,0.75);
    box-shadow: 0 0 0 3px rgba(201,161,74,0.15);
}

.gate-input.error {
    border-color: #d97a2a;
    animation: gateShake 0.5s;
}

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

.gate-submit {
    background: linear-gradient(135deg, #5a1a1a, #8b2c2c);
    color: #e0bd5e;
    border: 1px solid #c9a14a;
    padding: 1.05rem;
    font-family: "Cinzel", serif;
    font-size: 0.78rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    cursor: pointer;
    transition: 0.4s cubic-bezier(.2,.8,.3,1);
    font-weight: 600;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.gate-submit::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #8b2c2c, #c9a14a);
    opacity: 0;
    transition: 0.4s;
    z-index: -1;
}

.gate-submit:hover {
    box-shadow: 0 14px 40px rgba(201,161,74,0.35);
    transform: translateY(-2px);
    color: #faf6ee;
}

.gate-submit:hover::before { opacity: 1; }

.gate-error {
    color: #e89940;
    font-size: 0.84rem;
    text-align: center;
    min-height: 18px;
    font-style: italic;
    opacity: 0;
    transition: opacity 0.3s;
    letter-spacing: 0.04em;
}

.gate-error.show { opacity: 1; }

.gate-foot {
    margin-top: 2rem;
    text-align: center;
    color: rgba(250,246,238,0.45);
    font-size: 0.78rem;
    font-family: "Cormorant Garamond", serif;
    font-style: italic;
    letter-spacing: 0.04em;
}

.gate-foot a {
    color: #c9a14a;
    text-decoration: none;
}

.gate-foot a:hover { text-decoration: underline; }

/* Sacred Transition */
.sacred-transition {
    position: fixed;
    inset: 0;
    background: #0f1626;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.7s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sacred-transition.active {
    opacity: 1;
    pointer-events: auto;
}

.sacred-transition-mark {
    width: 80px;
    height: 80px;
    border: 1px solid #c9a14a;
    border-radius: 50%;
    border-top-color: transparent;
    animation: sacredSpin 1.2s linear infinite;
}

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

@media (max-width: 540px) {
    .gate-content { padding: 2rem 1.4rem; }
    .gate-card { padding: 2rem 1.4rem; }
    .gate-emblem-mark { width: 72px; height: 72px; font-size: 1.6rem; }
}
