:root {
    --orange-500: #f97316;
    --orange-600: #ea580c;
    --orange-700: #c2410c;
    --ring-shadow: 0 0 0 4px rgba(249, 115, 22, .15);
}

/* Fondo y layout solo para el login */
#loginSection.section.active {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 3rem 1rem;
    background: radial-gradient(1200px 600px at 10% -10%, #fff7ed 20%, transparent 60%),
        radial-gradient(1000px 600px at 110% 10%, #ffedd5 10%, transparent 60%),
        linear-gradient(180deg, #fff 0%, #fff7ed 60%, #ffedd5 100%);
}

/* Título */
#loginSection h2 {
    margin: 0 0 1rem 0;
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    background: linear-gradient(135deg, var(--orange-600), var(--orange-500));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* “Card” usando el form existente */
#loginSection form {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    background: #fff;
    border-radius: 1.25rem;
    padding: 1.75rem;
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .15), 0 10px 20px -10px rgba(0, 0, 0, .1);
    position: relative;
}

#loginSection form::before {
    content: "";
    position: absolute;
    inset: -1px -1px auto auto;
    width: 140px;
    height: 140px;
    background: conic-gradient(from 200deg at 70% 30%, rgba(249, 115, 22, .18), rgba(234, 88, 12, .08), transparent 40%);
    border-bottom-left-radius: 100%;
    pointer-events: none;
}

/* Labels + inputs */
#loginSection label {
    display: block;
    font-size: .9rem;
    font-weight: 600;
    color: #374151;
    margin: .25rem 0 .35rem;
}

#loginSection input[type="text"],
#loginSection input[type="password"] {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: .75rem;
    padding: .75rem .9rem;
    font-size: 1rem;
    color: #111827;
    background: #fff;
    transition: box-shadow .2s ease, border-color .2s ease, transform .05s ease;
}

#loginSection input:focus {
    outline: none;
    border-color: var(--orange-500);
    box-shadow: var(--ring-shadow);
}

/* Botón */
#loginSection button[type="submit"] {
    margin-top: .9rem;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .8rem 1rem;
    border-radius: .9rem;
    border: 1px solid transparent;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--orange-500), var(--orange-600));
    box-shadow: 0 10px 20px -8px rgba(234, 88, 12, .5);
    transition: transform .06s ease, filter .2s ease, box-shadow .2s ease;
    cursor: pointer;
}

#loginSection button[type="submit"]:hover {
    filter: brightness(1.03);
    box-shadow: 0 18px 30px -12px rgba(234, 88, 12, .55);
}

#loginSection button[type="submit"]:active {
    transform: translateY(1px);
}

#loginSection button[type="submit"]:disabled {
    opacity: .6;
    cursor: not-allowed;
    box-shadow: none;
}

/* Enlace “¿Olvidaste tu contraseña?”: centrado y acorde a la card */
#loginSection>div[style] {
    max-width: 460px;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: right !important;
}

#loginSection #forgotPasswordLink {
    color: var(--orange-600) !important;
}

#loginSection #forgotPasswordLink:hover {
    color: var(--orange-700) !important;
    text-decoration: underline !important;
}

/* Error box */
#loginSection .error-message {
    margin-top: .75rem;
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: .75rem;
    padding: .65rem .9rem;
    font-size: .9rem;
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
}

/* Spinner por clase .is-loading en el botón */
#loginSection button[type="submit"].is-loading {
    position: relative;
}

#loginSection button[type="submit"].is-loading::after {
    content: "";
    width: 18px;
    height: 18px;
    border-radius: 9999px;
    border: 3px solid #fff;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

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

/* ===== Modales Thor/ThorIA — look naranja/blanco ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    /* oculto por defecto */
    align-items: center;
    justify-content: center;
    background: rgba(249, 115, 22, 0.10);
    /* naranja muy suave */
    backdrop-filter: blur(3px) saturate(110%);
    z-index: 1000;
}

.modal-overlay.is-visible {
    display: flex;
}

.modal-overlay[hidden] {
    display: none;
}

.modal-card {
    width: min(92vw, 520px);
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #fff8f1 100%);
    border: 1px solid rgba(253, 186, 116, 0.55);
    /* borde melocotón */
    box-shadow:
        0 30px 60px -20px rgba(255, 115, 0, 0.35),
        0 18px 40px -30px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: modalIn .25s ease-out;
}

.modal-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 16px 20px;
    background: linear-gradient(90deg, #ffedd5 0%, #fff7ed 100%);
    border-bottom: 1px solid rgba(253, 186, 116, 0.55);
}

.modal-icon {
    font-size: 1.25rem;
}

.modal-title {
    margin: 0;
    color: #f97316;
    /* naranja principal */
    font-weight: 800;
    letter-spacing: .2px;
}

.modal-body {
    padding: 20px;
    color: #374151;
}

.field-label {
    display: block;
    font-size: .85rem;
    color: #6b7280;
    margin: 0 0 .35rem;
}

.input {
    width: 100%;
    border: 1.5px solid #fed7aa;
    border-radius: 12px;
    background: #fff;
    padding: 12px 14px;
    outline: none;
    transition: border .15s, box-shadow .15s;
}

.input:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.15);
}

.input.centered {
    text-align: center;
    letter-spacing: .3em;
    font-weight: 700;
}

.qr-box {
    min-height: 160px;
    display: grid;
    place-items: center;
    background: #fff;
    border: 2px dashed #fb923c;
    /* naranja claro */
    border-radius: 16px;
    padding: 16px;
    margin: 12px 0 4px;
}

.hint {
    margin-top: 10px;
    font-size: .78rem;
    color: #9ca3af;
}

.muted {
    color: #6b7280;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
    padding: 14px 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .7) 0%, #fff7ed 100%);
    border-top: 1px solid rgba(253, 186, 116, 0.45);
}

.btn {
    appearance: none;
    border: 0;
    cursor: pointer;
    border-radius: 12px;
    padding: 10px 16px;
    font-weight: 700;
    transition: transform .05s ease, box-shadow .2s ease, filter .2s;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(180deg, #ff7a1a 0%, #ff5c00 100%);
    box-shadow: 0 8px 18px rgba(255, 90, 0, 0.35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(255, 90, 0, 0.38);
}

.btn-primary:active {
    transform: translateY(0);
    filter: saturate(95%);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}