/**
 * auth.css — Estilos compartidos para páginas de autenticación
 * (login, recuperar contraseña, nueva contraseña)
 */

:root {
    --bg: #F5F5F7;
    --surface: #FFFFFF;
    --text-primary: #1D1D1F;
    --text-secondary: #86868B;
    --text-tertiary: #AEAEB2;
    --separator: rgba(60,60,67,0.12);
    --input-bg: #F5F5F7;
    --input-border: rgba(60,60,67,0.18);
    --input-focus: #007AFF;
    --blue: #007AFF;
    --blue-hover: #0066D6;
    --red: #FF3B30;
    --green: #34C759;
    --radius: 13px;
    --radius-lg: 20px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display',
                 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Layout ── */
.login-container {
    width: 100%;
    max-width: 366px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ── Logo ── */
.login-logo {
    margin-bottom: 36px;
    text-align: center;
}

.login-logo img {
    height: 34px;
    width: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* ── Card ── */
.login-card {
    width: 100%;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 32px 28px 28px;
    box-shadow: 0 0 0 0.33px var(--separator),
                0 2px 8px rgba(0,0,0,0.04);
}

.login-heading {
    font-size: 21px;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.login-subheading {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 28px;
    line-height: 1.45;
}

/* ── Alerts ── */
.login-alert {
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 20px;
    text-align: center;
}

.login-alert--error {
    background: rgba(255,59,48,0.08);
    color: var(--red);
}

.login-alert--success {
    background: rgba(52,199,89,0.08);
    color: var(--green);
}

/* ── Form fields (grouped iOS-style) ── */
.login-fields {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--input-bg);
    border-radius: var(--radius);
    border: 0.33px solid var(--input-border);
    overflow: hidden;
    margin-bottom: 20px;
}

.login-field {
    position: relative;
}

.login-field + .login-field {
    border-top: 0.33px solid var(--separator);
}

.login-field label {
    position: absolute;
    left: 16px;
    top: 8px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    pointer-events: none;
    letter-spacing: 0.01em;
}

.login-field input[type="text"],
.login-field input[type="email"],
.login-field input[type="password"] {
    width: 100%;
    padding: 25px 16px 9px;
    border: none;
    background: transparent;
    font-size: 16px;
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
}

.login-field input::placeholder {
    color: var(--text-tertiary);
}

.login-field--password input {
    padding-right: 48px;
}

.login-field:focus-within {
    box-shadow: inset 0 0 0 2px var(--input-focus);
    border-radius: var(--radius);
    z-index: 1;
}

/* ── Password toggle ── */
.pass-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-tertiary);
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
}

.pass-toggle:hover,
.pass-toggle:focus-visible {
    color: var(--text-secondary);
}

.pass-toggle svg {
    width: 18px;
    height: 18px;
}

/* ── Remember me (login only) ── */
.login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.login-remember input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 1.5px solid var(--input-border);
    background: var(--input-bg);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.login-remember input[type="checkbox"]:checked {
    background: var(--blue);
    border-color: var(--blue);
}

.login-remember input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 3px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}

.login-remember span {
    font-size: 13px;
    color: var(--text-secondary);
    user-select: none;
}

/* ── Submit button ── */
.login-submit {
    width: 100%;
    padding: 13px;
    background: var(--blue);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
    letter-spacing: 0;
}

.login-submit:hover {
    background: var(--blue-hover);
}

.login-submit:active {
    transform: scale(0.98);
}

.login-submit:disabled {
    opacity: 0.55;
    cursor: default;
    transform: none;
}

/* ── WhatsApp link ── */
.login-wa {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    padding: 11px;
    border-radius: var(--radius);
    background: rgba(37,211,102,0.08);
    color: #128C7E;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease;
}

.login-wa:hover {
    background: rgba(37,211,102,0.15);
}

/* ── Footer ── */
.login-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 0.33px solid var(--separator);
    font-size: 12px;
    color: var(--text-tertiary);
    text-align: center;
    line-height: 1.5;
}

.login-footer a {
    color: var(--blue);
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

.login-copyright {
    margin-top: 28px;
    font-size: 11px;
    color: var(--text-tertiary);
    text-align: center;
    letter-spacing: 0.01em;
}

/* ── Animations ── */
@media (prefers-reduced-motion: no-preference) {
    .login-logo {
        animation: fadeDown 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
    }
    .login-card {
        animation: fadeUp 0.45s cubic-bezier(0.34,1.56,0.64,1) 0.08s both;
    }
    .login-footer,
    .login-copyright {
        animation: fadeIn 0.4s ease 0.2s both;
    }
}

@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-12px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
