[hidden] { display: none !important; }
.auth-tabs { display: flex; gap: 12px; margin-bottom: 24px; }
.auth-message { margin-top: 18px; text-align: center; min-height: 1.5em; }
.app-version {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 20;
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--glass-bg);
    color: var(--gold-primary);
    font-family: var(--font-serif);
    font-size: 11px;
    letter-spacing: .04em;
    pointer-events: none;
}
/* ==========================================================================
   RESET & VARIÁVEIS MÍSTICAS
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #050508;
    --gold-primary: #d4af37;
    --gold-light: #fef08a;
    --gold-glow: rgba(212, 175, 55, 0.45);
    --purple-dark: #120924;
    --purple-accent: #8b5cf6;
    --glass-bg: rgba(13, 10, 25, 0.85);
    --glass-border: rgba(212, 175, 55, 0.28);
    --font-serif: 'Cinzel', serif;
    --font-title: 'Cinzel Decorative', cursive;
    --font-body: 'Cormorant Garamond', serif;
}

body {
    background-color: var(--bg-dark);
    color: #e2e8f0;
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
    padding: 30px 15px;
}

/* ==========================================================================
   EFEITOS DE FUNDO (NÉVOA E ESTRELAS)
   ========================================================================== */
.stars-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(1.5px 1.5px at 20px 30px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 40px 70px, rgba(212, 175, 55, 0.8), rgba(0,0,0,0)),
        radial-gradient(2px 2px at 90px 40px, #a855f7, rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 160px 120px, #fff, rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 200px 200px;
    opacity: 0.4;
    z-index: 1;
    animation: starsPulse 8s infinite alternate ease-in-out;
}

.nebula-glow {
    position: fixed;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.16) 0%, rgba(6, 182, 212, 0.08) 40%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    pointer-events: none;
    filter: blur(60px);
}

@keyframes starsPulse {
    0% { opacity: 0.3; transform: scale(1); }
    100% { opacity: 0.6; transform: scale(1.03); }
}

/* ==========================================================================
   CONTAINER DO FORMULÁRIO
   ========================================================================== */
.login-wrapper {
    position: relative;
    z-index: 10;
    padding: 20px 10px;
    width: 100%;
    max-width: 590px;
}

.login-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 48px 38px 38px;
    box-shadow: 
        0 25px 60px rgba(0, 0, 0, 0.88),
        inset 0 0 25px rgba(139, 92, 246, 0.08),
        0 0 35px rgba(212, 175, 55, 0.14);
    position: relative;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.login-card:hover {
    border-color: rgba(212, 175, 55, 0.45);
    box-shadow: 
        0 25px 65px rgba(0, 0, 0, 0.95),
        inset 0 0 30px rgba(139, 92, 246, 0.15),
        0 0 45px rgba(212, 175, 55, 0.22);
}

/* Cabeçalho */
.card-header {
    text-align: center;
    margin-bottom: 25px;
}

.symbol-top {
    color: var(--gold-primary);
    font-size: 1rem;
    letter-spacing: 5px;
    opacity: 0.85;
}

.portal-title {
    font-family: var(--font-title);
    font-size: 1.85rem;
    color: #f8fafc;
    letter-spacing: 2px;
    margin: 8px 0 6px;
    text-shadow: 0 0 12px rgba(212, 175, 55, 0.38);
}

.portal-subtitle {
    font-size: 0.98rem;
    color: #94a3b8;
    font-style: italic;
}

/* ==========================================================================
   MOEDAS DOS SEIS ELEMENTOS
   ========================================================================== */
.element-coins-container {
    height: 126px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
    position: relative;
}

.element-coins {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(6, 72px);
    grid-template-rows: 110px;
    place-content: center;
    gap: 14px;
    perspective: 760px;
}

.element-coin {
    --coin-accent: #d4af37;
    --coin-deep: #4c3210;
    position: relative;
    width: 72px;
    height: 110px;
    min-width: 0;
    min-height: 0;
    border: 0;
    background: transparent;
    color: #fff7cc;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    padding: 0;
    outline: none;
    overflow: visible;
    user-select: none;
    transform-style: preserve-3d;
    isolation: isolate;
}

/* Espessura metálica: uma segunda moeda deslocada atrás da face. */
.element-coin::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid color-mix(in srgb, var(--coin-accent) 45%, #08050f 55%);
    background:
        linear-gradient(180deg,
            color-mix(in srgb, var(--coin-accent) 46%, #17101f 54%) 0%,
            color-mix(in srgb, var(--coin-deep) 74%, #050508 26%) 48%,
            #050307 100%);
    box-shadow:
        0 3px 0 color-mix(in srgb, var(--coin-accent) 75%, #08050f 64%),
        0 12px 0 color-mix(in srgb, var(--coin-deep) 100%, #050508 24%),
        0 9px 0 #050307,
        0 15px 14px rgba(0,0,0,.76),
        0 0 15px color-mix(in srgb, var(--coin-accent) 25%, transparent);
    transform-origin: center 78%;
    transform: rotateX(68deg) translateX(-2px) translateY(-11px) translateZ(-7px);
    filter: brightness(.72) saturate(.8);
    pointer-events: none;
    transition: transform .38s cubic-bezier(.2,.85,.25,1), box-shadow .38s ease, filter .3s ease;
}

.coin-face {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid color-mix(in srgb, var(--coin-accent) 76%, white 24%);
    background:
        radial-gradient(circle at 36% 30%, rgba(255,255,255,.34) 0 4%, transparent 5%),
        repeating-conic-gradient(from 0deg, rgba(255,255,255,.08) 0 4deg, transparent 4deg 12deg),
        radial-gradient(circle at 50% 45%, var(--coin-accent), var(--coin-deep) 68%, #08050f 100%);
    box-shadow:
        inset 0 0 0 4px rgba(5, 5, 8, .65),
        inset 0 0 0 6px color-mix(in srgb, var(--coin-accent) 55%, transparent),
        inset 0 -8px 12px rgba(0,0,0,.48),
        0 12px 10px rgba(0,0,0,.78),
        0 0 16px color-mix(in srgb, var(--coin-accent) 30%, transparent);
    overflow: hidden;
    transform-origin: center 78%;
    transform: rotateX(68deg) translateY(7px);
    filter: saturate(.88) brightness(.82);
    transition: transform .38s cubic-bezier(.2,.85,.25,1), box-shadow .38s ease, filter .3s ease;
}

.coin-face::before,
.coin-face::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.coin-face::before {
    inset: 8px;
    border: 1px solid rgba(255,255,255,.35);
}

.coin-face::after {
    inset: 14px;
    border: 1px dashed color-mix(in srgb, var(--coin-accent) 70%, white 30%);
    opacity: .72;
}

.coin-ring {
    position: relative;
    z-index: 1;
    font-family: var(--font-serif);
    font-size: 1.85rem;
    line-height: 1;
    color: #fff7cc;
    text-shadow: 0 0 9px var(--coin-accent), 0 2px 2px rgba(0,0,0,.8);
}

.coin-name {
    position: relative;
    z-index: 1;
    font-family: var(--font-serif);
    font-size: .58rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
    text-shadow: 0 1px 3px #000;
    line-height: 1.12;
    min-height: 1.3em;
    text-align: center;
    transition: color .3s ease, text-shadow .3s ease;
}

.coin-spirit    { --coin-accent: #d8b4fe; --coin-deep: #4c1d95; }
.coin-air       { --coin-accent: #67e8f9; --coin-deep: #155e75; }
.coin-fire      { --coin-accent: #fb7185; --coin-deep: #881337; }
.coin-water     { --coin-accent: #60a5fa; --coin-deep: #1e3a8a; }
.coin-earth     { --coin-accent: #6ee7b7; --coin-deep: #14532d; }
.coin-light-dark {
    --coin-accent: #f8fafc;
    --coin-deep: #312e81;
}
.coin-light-dark .coin-face {
    background:
        radial-gradient(circle at 36% 30%, rgba(255,255,255,.45) 0 4%, transparent 5%),
        repeating-conic-gradient(from 0deg, rgba(255,255,255,.09) 0 4deg, transparent 4deg 12deg),
        conic-gradient(from 90deg, #e2e8f0 0 50%, #111827 50% 100%);
    color: #fef3c7;
}

.element-coin:hover,
.element-coin:focus-visible {
    z-index: 10;
}

.element-coin:hover .coin-face,
.element-coin:focus-visible .coin-face {
    transform: rotateX(0deg) translateY(-5px);
    filter: saturate(1.2) brightness(1.08);
    box-shadow:
        inset 0 0 0 4px rgba(5, 5, 8, .55),
        inset 0 0 0 6px color-mix(in srgb, var(--coin-accent) 70%, transparent),
        inset 0 -10px 16px rgba(0,0,0,.38),
        0 14px 24px rgba(0,0,0,.82),
        0 0 30px color-mix(in srgb, var(--coin-accent) 58%, transparent);
}

.element-coin:hover::before,
.element-coin:focus-visible::before {
    transform: rotateX(0deg) translateX(-2px) translateY(-7px) translateZ(-7px);
    filter: brightness(.9) saturate(1);
    box-shadow:
        0 2px 0 color-mix(in srgb, var(--coin-accent) 40%, #08050f 60%),
        0 4px 0 color-mix(in srgb, var(--coin-deep) 72%, #050508 28%),
        0 7px 0 #050307,
        0 17px 19px rgba(0,0,0,.8),
        0 0 22px color-mix(in srgb, var(--coin-accent) 34%, transparent);
}

.element-coin:hover .coin-name,
.element-coin:focus-visible .coin-name {
    color: var(--coin-accent);
    text-shadow: 0 0 9px color-mix(in srgb, var(--coin-accent) 65%, transparent);
}

/* ==========================================================================
   CAMPOS DO FORMULÁRIO (INPUTS)
   ========================================================================== */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-label {
    font-family: var(--font-serif);
    font-size: 0.85rem;
    color: #cbd5e1;
    letter-spacing: 1px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    width: 20px;
    height: 20px;
    color: var(--gold-primary);
    opacity: 0.7;
    pointer-events: none;
    transition: opacity 0.3s ease, color 0.3s ease;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    background: rgba(10, 7, 20, 0.75);
    border: 1px solid rgba(212, 175, 55, 0.24);
    border-radius: 9px;
    color: #f8fafc;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.input-wrapper input::placeholder {
    color: #475569;
    font-style: italic;
}

.input-wrapper input:focus {
    border-color: var(--purple-accent);
    background: rgba(18, 12, 36, 0.92);
    box-shadow: 
        0 0 14px rgba(139, 92, 246, 0.35),
        inset 0 0 8px rgba(139, 92, 246, 0.15);
}

.input-wrapper input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
    opacity: 1;
    color: var(--purple-accent);
}

/* ==========================================================================
   BOTÃO "ADENTRAR O REINO CELESTE"
   ========================================================================== */
.submit-btn {
    position: relative;
    margin-top: 10px;
    padding: 16px;
    background: linear-gradient(135deg, #221540, #100b21);
    border: 1px solid var(--gold-primary);
    border-radius: 9px;
    color: var(--gold-primary);
    font-family: var(--font-serif);
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: 1.8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.55);
}

.submit-btn .btn-symbol {
    font-size: 0.85rem;
    transition: transform 0.3s ease;
}

.submit-btn:hover {
    color: #ffffff;
    background: linear-gradient(135deg, #331f5d, #1a1036);
    border-color: var(--gold-light);
    box-shadow: 
        0 0 24px rgba(212, 175, 55, 0.48),
        0 0 12px rgba(139, 92, 246, 0.45);
    transform: translateY(-2px);
}

.submit-btn:hover .btn-symbol {
    transform: rotate(90deg) scale(1.2);
}

/* Rodapé */
.card-footer {
    text-align: center;
    margin-top: 22px;
}

.forgot-link {
    color: #94a3b8;
    font-size: 0.88rem;
    text-decoration: none;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: var(--gold-primary);
    text-decoration: underline;
}

/* ==========================================================================
   MODAL MÍSTICO
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 2, 8, 0.84);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: linear-gradient(145deg, rgba(22, 15, 42, 0.96), rgba(10, 6, 20, 0.98));
    border: 1px solid var(--gold-primary);
    border-radius: 18px;
    width: 100%;
    max-width: 420px;
    padding: 30px 26px;
    position: relative;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.9),
        0 0 30px rgba(212, 175, 55, 0.3);
    text-align: center;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.27);
}

.modal-overlay.active .modal-card {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--gold-primary);
}

.modal-header {
    margin-top: 5px;
}

.modal-number {
    font-family: var(--font-serif);
    font-size: 0.82rem;
    color: var(--gold-primary);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.modal-title {
    font-family: var(--font-title);
    font-size: 1.55rem;
    color: #f8fafc;
    margin-top: 4px;
}

.modal-divider {
    color: var(--gold-primary);
    font-size: 0.78rem;
    margin: 12px 0;
    opacity: 0.7;
}

.modal-text {
    font-size: 1.08rem;
    line-height: 1.55;
    color: #cbd5e1;
    margin-bottom: 24px;
    font-style: italic;
}

.modal-action-btn {
    width: 100%;
    padding: 12px;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid var(--gold-primary);
    border-radius: 7px;
    color: var(--gold-primary);
    font-family: var(--font-serif);
    font-size: 0.88rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.modal-action-btn:hover {
    background: var(--gold-primary);
    color: var(--bg-dark);
    font-weight: 600;
}

/* ==========================================================================
   RESPONSIVIDADE (DISPOSITIVOS MÓVEIS)
   ========================================================================== */
@media (max-width: 580px) {
    .login-card {
        padding: 30px 16px;
    }

    .element-coins-container {
        height: 226px;
        margin-bottom: 30px;
    }

    .element-coins {
        grid-template-columns: repeat(3, 72px);
        grid-template-rows: repeat(2, 100px);
        gap: 16px 22px;
    }

    .element-coin {
        width: 72px;
        height: 100px;
    }

    .coin-ring { font-size: 1.7rem; }
    .coin-name { font-size: .54rem; letter-spacing: .05em; }

    .portal-title {
        font-size: 1.4rem;
    }
}

@media (max-width: 360px) {
    .element-coins {
        grid-template-columns: repeat(3, 64px);
        grid-template-rows: repeat(2, 94px);
        gap: 14px 16px;
    }

    .element-coin {
        width: 64px;
        height: 94px;
    }

    .coin-face { width:64px; height:64px; flex-basis:64px; }
    .element-coin::before { width:64px; height:64px; }
}
