/* style.css - Estilos base para InvisibleLink */

/* ============== Reset básico ============== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ============== Tipografía global y fondo ============== */
html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    font-family: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at top left, #1d4ed8, #020617) fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 16px;
    color: #e5e7eb;
    /* sutil animación del fondo */
    background-size: 140% 140%;
    animation: bg-pulse 16s ease-in-out infinite;
}

@keyframes bg-pulse {
    0% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 0%;
    }
}

/* Contenedor principal para login / registro */
.app-shell {
    width: 100%;
    max-width: 480px;
}

/* ============== Tarjeta principal ============== */
.card {
    background: rgba(15, 23, 42, 0.96);
    border-radius: 24px;
    padding: 28px 22px 24px;
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
    /* animación de entrada */
    opacity: 0;
    transform: translateY(16px) scale(0.99);
    animation: card-in 0.45s ease-out forwards;
}

@keyframes card-in {
    0% {
        opacity: 0;
        transform: translateY(16px) scale(0.99);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header de la tarjeta */
.card-header {
    margin-bottom: 16px;
    text-align: center;
}

.card-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.card-logo img {
    max-width: 220px;
    height: auto;
    display: block;
    filter: drop-shadow(0 8px 22px rgba(15, 23, 42, 0.8));
}

.card-title {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 4px;
}

.card-subtitle {
    font-size: 0.9rem;
    color: #9ca3af;
}

/* ============== Formulario ============== */
.form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 16px;
    margin-bottom: 18px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-field label {
    font-size: 0.85rem;
    color: #cbd5f5;
}

.form-field input {
    width: 100%;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
    font-size: 0.95rem;
    padding: 10px 14px;
    outline: none;
    transition:
        border-color 0.12s ease,
        box-shadow 0.12s ease,
        background 0.12s ease,
        transform 0.08s ease;
}

.form-field input::placeholder {
    color: #6b7280;
}

.form-field input:focus {
    border-color: #22c55e;
    box-shadow:
        0 0 0 1px rgba(34, 197, 94, 0.45),
        0 0 0 6px rgba(34, 197, 94, 0.12);
    background: rgba(15, 23, 42, 1);
    transform: translateY(-1px);
}

/* ============== Botones reutilizables ============== */
.btn {
    border: none;
    cursor: pointer;
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    transition:
        transform 0.12s ease,
        box-shadow 0.12s ease,
        filter 0.12s ease,
        background-position 0.15s ease;
    background-size: 140% 140%;
}

.btn-full {
    width: 100%;
}

.btn-primary {
    background-image: linear-gradient(135deg, #22c55e, #16a34a);
    color: #022c22;
    box-shadow: 0 18px 45px rgba(34, 197, 94, 0.55);
}

.btn-primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 22px 55px rgba(34, 197, 94, 0.65);
    background-position: 100% 0%;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 10px 30px rgba(34, 197, 94, 0.5);
}

/* Foco accesible en botones */
.btn:focus-visible {
    outline: 2px solid rgba(34, 197, 94, 0.9);
    outline-offset: 3px;
}

/* Footer de la tarjeta */
.card-footer-text {
    text-align: center;
    font-size: 0.85rem;
    color: #9ca3af;
    margin-top: 4px;
}

.card-footer-text a {
    color: #22c55e;
    text-decoration: none;
    font-weight: 500;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* subrayado suave al pasar el ratón */
.card-footer-text a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 1px;
    background: #22c55e;
    transition: width 0.15s ease;
}

.card-footer-text a:hover::after {
    width: 100%;
}

/* enlace "← Volver al inicio" algo más suave visualmente */
.card-footer-text a[href="index.php"] {
    color: #a5b4fc;
    font-weight: 500;
}

/* ============== Avisos ============== */
.alert {
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 0.85rem;
    margin-bottom: 14px;
}

.alert-success {
    background: rgba(22, 163, 74, 0.12);
    border: 1px solid rgba(22, 163, 74, 0.5);
    color: #bbf7d0;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.6);
    color: #fecaca;
}

/* ============== Bloque de recomendación ============== */
.affiliate-recos {
    display: none;
    margin-top: 18px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    text-align: left;
    color: #e5e7eb;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
}

.affiliate-recos__header {
    margin-bottom: 12px;
}

.affiliate-recos__title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
}

.affiliate-recos__note {
    font-size: 0.85rem;
    color: #9ca3af;
    margin-top: 6px;
    line-height: 1.4;
}

.affiliate-recos__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.affiliate-recos__item {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(0, 0, 0, 0.15);
}

.affiliate-recos__image {
    width: 100%;
    max-width: 96px;
    border-radius: 12px;
    background: #0b1224;
    object-fit: contain;
}

.affiliate-recos__info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.affiliate-recos__product-title {
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0;
}

.affiliate-recos__description {
    font-size: 0.9rem;
    color: #cbd5f5;
    line-height: 1.45;
    margin: 0;
}

.affiliate-recos__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 210px;
    min-height: 40px;
    padding: 10px 12px;
    border-radius: 8px;
    background-image: linear-gradient(135deg, #ffb347, #ff9900);
    color: #0b0f1a;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.92rem;
    letter-spacing: 0.01em;
    box-shadow: 0 10px 22px rgba(255, 153, 0, 0.35);
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
    align-self: center;
    justify-self: center;
    text-align: center;
    margin-top: 4px;
}

.affiliate-recos__cta:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 18px 42px rgba(34, 197, 94, 0.6);
}

.affiliate-recos__cta:active {
    transform: translateY(0);
    box-shadow: 0 10px 28px rgba(34, 197, 94, 0.5);
}

.affiliate-recos__cta:focus-visible {
    outline: 2px solid rgba(34, 197, 94, 0.9);
    outline-offset: 3px;
}

@media (max-width: 520px) {
    .affiliate-recos__item {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .affiliate-recos__image {
        max-width: 100%;
        justify-self: start;
    }
}

/* ============== Responsive ============== */
@media (max-width: 768px) {
    body {
        align-items: flex-start;
        padding: 20px 12px;
    }

    .card {
        border-radius: 20px;
        padding: 22px 18px 20px;
        box-shadow: 0 14px 36px rgba(0, 0, 0, 0.7);
    }

    .card-logo img {
        max-width: 190px;
    }

    .card-title {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 16px 10px;
    }

    .card {
        padding: 20px 16px 18px;
    }

    .form {
        gap: 12px;
    }

    .form-field input {
        font-size: 0.9rem;
        padding: 9px 13px;
    }

    .card-footer-text {
        font-size: 0.82rem;
    }
}
