/* ============================================================
   ENCOUNTER — Login styles
   @author Code4You
   ============================================================ */

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --gold:          #cbb027;
    --gold-light:    #F0C84A;
    --gold-dark:     #A07820;
    --sky-dark:      #0D1117;
    --text-light:    #E8E0D0;
    --text-muted:    #9A9FAA;
    --input-bg:      rgba(255,255,255,0.07);
    --input-border:  rgba(255,255,255,0.45);
    --input-focus:   rgba(255,255,255,0.70);
    --card-bg:       rgba(10,14,25,0.72);
}

html, body {
    height: 100%;
    font-family: 'Lato', sans-serif;
    background-color: var(--sky-dark);
    color: var(--text-light);
    overflow-x: hidden;
}

/* ===== BACKGROUND ===== */
.enc-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
}

.enc-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65)
}

/* ===== LAYOUT ===== */
.enc-page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

/* ===== LEFT PANEL ===== */
.enc-left {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.enc-left-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

/* Overlay desactivado — las imágenes ya traen su propio tratamiento */
.enc-left-overlay { display: none; }

/* Texto curvo en la esquina inferior izquierda */
.enc-curved-wrap {
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 3;
    padding: 32px;
}

.enc-curved-wrap svg {
    overflow: visible;
    width: 380px;
    max-width: 90vw;
}

/* ===== RIGHT PANEL ===== */
.enc-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 64px;
    position: relative;
}

/* Card del formulario con glass */
.enc-form-card {
    width: 100%;
    max-width: 480px;
    border-radius: 12px;
    padding: 70px 44px 70px;
    display: flex;
    height: 90%;
    flex-direction: column;
    justify-content: space-evenly;
}

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

/* ===== LOGO ===== */
.enc-logo-wrap {
    text-align: center;
    margin-bottom: 36px;
}

.enc-logo-wrap img {
    width: 100%;
    max-width: 300px;
    display: inline-block;
    filter: drop-shadow(0 2px 16px rgba(212,168,51,0.30));
}

/* ===== FIELDS ===== */
.enc-field {
    margin-bottom: 22px;
}

.enc-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: #fff;
    margin-bottom: 8px;
}

.enc-field input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 4px;
    padding: 13px 16px;
    font-family: 'Lato', sans-serif;
    font-size: 0.95rem;
    color: var(--text-light);
    outline: none;
    transition: border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
    letter-spacing: 0.02em;
}

.enc-field input::placeholder {
    color: rgba(232,224,208,0.28);
}

.enc-field input:focus {
    border-color: var(--input-focus);
    background: rgba(255,255,255,0.10);
    box-shadow:
        0 0 0 3px rgba(212,168,51,0.10),
        inset 0 0 18px rgba(212,168,51,0.03);
}

.enc-field input.is-error {
    border-color: rgba(220,80,80,0.65);
    box-shadow: 0 0 0 3px rgba(220,80,80,0.10);
}

/* ===== SUBMIT BUTTON ===== */
.enc-btn {
    width: 100%;
    background: var(--gold);
    border: none;
    border-radius: 4px;
    padding: 14px 24px;
    font-family: 'Lato', sans-serif;
    font-size: 0.85rem;
    font-weight: 900;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.12s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
    margin-top: 10px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Shimmer */
.enc-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255,255,255,0.22) 50%,
        transparent 100%);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.enc-btn:hover::before  { transform: translateX(100%); }
.enc-btn:hover          { background: var(--gold-light); box-shadow: 0 6px 28px rgba(212,168,51,0.32); }
.enc-btn:active         { transform: translateY(1px); }
.enc-btn:disabled       { opacity: 0.55; cursor: not-allowed; }

/* Spinner dentro del botón */
.enc-btn .enc-spinner {
    display: none;
    width: 17px;
    height: 17px;
    border: 2px solid rgba(13,17,23,0.28);
    border-top-color: #0D1117;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

.enc-btn.loading .enc-label   { display: none; }
.enc-btn.loading .enc-spinner { display: block; }

/* ===== MESSAGES ===== */
.enc-error-msg {
    display: none;
    background: rgba(220,80,80,0.10);
    border: 1px solid rgba(220,80,80,0.28);
    border-radius: 4px;
    padding: 11px 14px;
    font-size: 0.85rem;
    color: #F08080;
    margin-bottom: 18px;
    line-height: 1.45;
    text-align: center;
}

.enc-error-msg.visible { display: block; }

.enc-success-msg {
    display: none;
    text-align: center;
    padding: 16px 0 8px;
}

.enc-success-msg.visible { display: block; }

.enc-success-icon {
    font-size: 2.2rem;
    margin-bottom: 14px;
    animation: pulseGold 1.2s ease infinite alternate;
}

@keyframes pulseGold {
    from { text-shadow: 0 0 0 rgba(212,168,51,0); }
    to   { text-shadow: 0 0 18px rgba(212,168,51,0.6); }
}

.enc-success-text {
    font-family: 'Cinzel', serif;
    font-size: 1.05rem;
    letter-spacing: 0.1em;
    color: var(--gold-light);
    margin-bottom: 6px;
}

.enc-success-sub {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ===== FOOTER NOTE ===== */
.enc-form-note {
    margin-top: 28px;
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.65;
    text-align: center;
    opacity: 0.8;
}

/* ===== STARS ===== */
.enc-star {
    position: fixed;
    width: 2px;
    height: 2px;
    background: var(--gold-light);
    border-radius: 50%;
    opacity: 0;
    animation: twinkle 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes twinkle {
    0%, 100% { opacity: 0;   transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(1.6); }
}

/* ===== SHAKE ANIMATION ===== */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-7px); }
    40%       { transform: translateX(7px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}

.enc-form-card.shake { animation: shake 0.4s ease; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .enc-page {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
    }

    /* Form arriba, imagen abajo */
    .enc-right {
        order: 1;
        padding: 48px 32px 40px;
    }

    .enc-left {
        order: 2;
        height: auto;
        display: flex;
    }

    .enc-right::before { display: none; }
}

@media (max-width: 520px) {
    .enc-right {
        order: 1;
        padding: 44px 20px 36px;
        align-items: flex-start;
        padding-top: 52px;
    }

    .enc-left {
        order: 2;
        height: auto;
        display: flex;
    }

    .enc-form-card {
        padding: 36px 24px;
        border-radius: 10px;
    }
}