/* =============================================
   Kairos — Auth Pages Shared Styles
   ============================================= */

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

html {
    font-size: 16px;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0f0f0f 100%);
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    position: relative;
    overflow-x: hidden;
}

/* Partículas doradas */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(2px 2px at 20% 30%, rgba(207, 166, 59, 0.3), transparent),
        radial-gradient(2px 2px at 60% 70%, rgba(207, 166, 59, 0.2), transparent),
        radial-gradient(1px 1px at 50% 50%, rgba(255, 215, 0, 0.2), transparent),
        radial-gradient(1px 1px at 80% 10%, rgba(207, 166, 59, 0.3), transparent);
    background-size: 200% 200%;
    animation: shimmer 15s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% 0%; }
    50%       { background-position: 100% 100%; }
}

/* Contenedor principal */
.auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    animation: fadeUp 0.7s ease-out both;
}

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

/* Logo */
.auth-logo {
    text-align: center;
    margin-bottom: 1.6rem;
}

.auth-logo img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid rgba(207, 166, 59, 0.35);
    box-shadow:
        0 8px 32px rgba(207, 166, 59, 0.2),
        0 0 60px rgba(207, 166, 59, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.auth-logo img:hover {
    transform: scale(1.05);
    box-shadow:
        0 12px 48px rgba(207, 166, 59, 0.3),
        0 0 80px rgba(207, 166, 59, 0.15);
}

/* Card */
.auth-card {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(207, 166, 59, 0.18);
    border-radius: 16px;
    padding: 2rem;
    box-shadow:
        0 8px 40px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.03);
}

.auth-card-title {
    text-align: center;
    font-size: 1.45rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    background: linear-gradient(135deg, #cfa63b 0%, #f4d87f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-card-subtitle {
    text-align: center;
    color: #888;
    font-size: 0.875rem;
    margin-bottom: 1.6rem;
    line-height: 1.4;
}

/* Alerta de éxito */
.auth-alert {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.875rem;
    color: #86efac;
    margin-bottom: 1.2rem;
    line-height: 1.4;
}

/* Campos */
.auth-field {
    margin-bottom: 1rem;
}

.auth-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #aaa;
    margin-bottom: 0.4rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

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

.auth-input-wrap i {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #cfa63b;
    font-size: 0.82rem;
    pointer-events: none;
    z-index: 1;
}

.auth-input-wrap input {
    width: 100%;
    padding: 12px 14px 12px 38px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(207, 166, 59, 0.25);
    border-radius: 8px;
    color: #fff;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
    -webkit-appearance: none;
    appearance: none;
}

.auth-input-wrap input::placeholder {
    color: #555;
}

.auth-input-wrap input:focus {
    border-color: #cfa63b;
    background: rgba(207, 166, 59, 0.07);
    box-shadow: 0 0 0 3px rgba(207, 166, 59, 0.15);
}

.auth-input-wrap input.is-invalid {
    border-color: #e05c5c;
    box-shadow: 0 0 0 3px rgba(224, 92, 92, 0.12);
}

/* Botón mostrar/ocultar contraseña */
.auth-input-wrap .password-input {
    padding-right: 46px;
}

.auth-password-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #888;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    z-index: 1;
    font-size: 0.95rem;
    padding: 0;
}

.auth-password-toggle:hover {
    color: #cfa63b;
    background: rgba(207, 166, 59, 0.12);
}

.auth-password-toggle:focus-visible {
    outline: 2px solid #cfa63b;
    outline-offset: 1px;
}

.auth-error {
    margin-top: 0.35rem;
    font-size: 0.78rem;
    color: #f87171;
    line-height: 1.3;
}

/* Checkbox "recordarme" */
.auth-check-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.auth-check-row input[type="checkbox"] {
    accent-color: #cfa63b;
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.auth-check-row label {
    font-size: 0.875rem;
    color: #888;
    cursor: pointer;
    user-select: none;
}

/* Botón principal */
.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 13px;
    margin-top: 1.4rem;
    background: linear-gradient(135deg, #cfa63b 0%, #e0bf6b 100%);
    color: #0a0a0a;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.25s, box-shadow 0.25s;
    box-shadow: 0 4px 15px rgba(207, 166, 59, 0.3);
    position: relative;
    overflow: hidden;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    min-height: 48px;
}

.auth-btn::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.auth-btn:hover::before {
    width: 350px;
    height: 350px;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(207, 166, 59, 0.45);
}

.auth-btn:active {
    transform: translateY(0);
}

/* Divider */
.auth-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    margin: 1.4rem 0 1.1rem;
}

/* Links inferiores */
.auth-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    text-align: center;
}

.auth-footer a {
    font-size: 0.875rem;
    color: #cfa63b;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
    line-height: 1.5;
    padding: 2px 0;
}

.auth-footer a:hover {
    color: #f4d87f;
    text-decoration: underline;
}

.auth-footer .auth-muted {
    font-size: 0.875rem;
    color: #666;
    line-height: 1.5;
}

.auth-footer .auth-muted a {
    color: #cfa63b;
    font-weight: 600;
    text-decoration: none;
}

.auth-footer .auth-muted a:hover {
    color: #f4d87f;
    text-decoration: underline;
}

/* Ícono decorativo grande (para páginas de aviso) */
.auth-icon-hero {
    text-align: center;
    margin-bottom: 1rem;
}

.auth-icon-hero i {
    font-size: 2.8rem;
    background: linear-gradient(135deg, #cfa63b 0%, #f4d87f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* =============================================
   Responsive
   ============================================= */

/* Teléfonos medianos */
@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem 1.25rem;
        border-radius: 14px;
    }

    .auth-logo img {
        width: 85px;
        height: 85px;
    }

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

    .auth-input-wrap input {
        font-size: 16px; /* evita zoom automático en iOS */
        padding: 13px 14px 13px 38px;
    }

    .auth-input-wrap .password-input {
        padding-right: 46px;
    }

    .auth-btn {
        font-size: 0.95rem;
        padding: 14px;
    }
}

/* Teléfonos pequeños */
@media (max-width: 360px) {
    body {
        padding: 12px;
    }

    .auth-card {
        padding: 1.2rem 1rem;
    }

    .auth-logo img {
        width: 72px;
        height: 72px;
    }

    .auth-card-title {
        font-size: 1.15rem;
    }

    .auth-card-subtitle {
        font-size: 0.82rem;
    }
}

/* Landscape en móvil: logo más pequeño para ganar espacio vertical */
@media (max-height: 600px) and (orientation: landscape) {
    .auth-logo {
        margin-bottom: 0.8rem;
    }

    .auth-logo img {
        width: 64px;
        height: 64px;
    }

    .auth-card {
        padding: 1.2rem 1.5rem;
    }

    .auth-card-subtitle {
        margin-bottom: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
