/* =============================================
   LoVendoAqui — Estilos del sistema de login
   Tarjeta limpia sobre fondo verde tenue
   ============================================= */

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

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: linear-gradient(160deg, #f0fdf4 0%, #f7faf8 55%, #eef7f1 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    color: #111827;
    -webkit-font-smoothing: antialiased;
}

/* ---- Tarjeta ---- */
.auth-container {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border: 1px solid #eef1ef;
    border-radius: 18px;
    padding: 32px 28px;
    box-shadow: 0 10px 30px rgba(17, 24, 39, 0.08), 0 2px 8px rgba(17, 24, 39, 0.04);
    margin: auto;
}

.auth-logo {
    text-align: center;
    margin-bottom: 24px;
    font-size: 1.65rem;
    font-weight: 900;
    letter-spacing: -1px;
    color: #111827;
}
.auth-logo span { color: #16a34a; }
.auth-logo-img { height: 52px; width: auto; }

.auth-btn-google {
    width: 100%;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    background: #ffffff; color: #374151;
    border: 1.5px solid #d1d5db; border-radius: 10px;
    padding: 13px; font-size: 0.95rem; font-weight: 600;
    cursor: pointer; font-family: inherit;
}
.auth-btn-google:hover { background: #f9fafb; border-color: #9ca3af; }

.auth-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #111827;
    margin-bottom: 6px;
    letter-spacing: -0.4px;
}
.auth-subtitle {
    font-size: 0.88rem;
    color: #6b7280;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* ---- Alertas ---- */
.auth-alert {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 18px;
    line-height: 1.45;
}
.auth-alert.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.auth-alert.success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.auth-alert a { color: #16a34a; font-weight: 600; }

/* ---- Campos ---- */
.auth-field { margin-bottom: 16px; }
.auth-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 7px;
}
.auth-input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.92rem;
    font-family: inherit;
    color: #111827;
    background: #fff;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-input:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}
.auth-input::placeholder { color: #9ca3af; }
select.auth-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%236b7280'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
.auth-hint { font-size: 0.75rem; color: #9ca3af; margin-top: 5px; }

/* ---- Boton ---- */
.auth-btn {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 11px;
    background: #16a34a;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    margin-top: 6px;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.22);
    transition: background 0.15s, box-shadow 0.15s, transform 0.05s;
}
.auth-btn:hover { background: #15803d; box-shadow: 0 6px 16px rgba(22, 163, 74, 0.28); }
.auth-btn:active { background: #14532d; transform: translateY(1px); }
.auth-btn:disabled { background: #9ca3af; box-shadow: none; cursor: not-allowed; }

/* ---- Enlaces / pie ---- */
.auth-link-row { text-align: right; margin-bottom: 18px; }
.auth-link-row a, .auth-link {
    font-size: 0.84rem;
    color: #16a34a;
    text-decoration: none;
    font-weight: 500;
}
.auth-link-row a:hover, .auth-link:hover { text-decoration: underline; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0;
    color: #9ca3af;
    font-size: 0.8rem;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.auth-footer { text-align: center; font-size: 0.88rem; color: #6b7280; margin-top: 20px; }
.auth-footer a { color: #16a34a; text-decoration: none; font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #6b7280;
    font-size: 0.84rem;
    text-decoration: none;
    margin-bottom: 20px;
    font-weight: 500;
}
.auth-back:hover { color: #16a34a; }

/* ---- Verificacion / codigo OTP ---- */
.auth-icon-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.5rem;
}
.auth-code-input {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 10px;
    font-family: monospace;
    padding: 14px;
}
.auth-center { text-align: center; }

/* ---- Telefono con prefijo (registro) ---- */
.tel-row { display: flex; gap: 8px; }
.pais-select-wrap { position: relative; flex-shrink: 0; width: 155px; }
.pais-select {
    width: 100%;
    padding: 12px 28px 12px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #374151;
    background: #fff;
    font-family: inherit;
    appearance: none;
    cursor: pointer;
    outline: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%236b7280'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.pais-select:focus { border-color: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12); }
.tel-input-wrap { flex: 1; min-width: 0; }
.tel-input-wrap input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.92rem;
    font-family: inherit;
    color: #111827;
    outline: none;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.tel-input-wrap input:focus { border-color: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12); }
.tel-input-wrap input::placeholder { color: #9ca3af; }

/* ---- Spinners / overlay de carga ---- */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.92);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    gap: 20px;
}
.loading-overlay.show { display: flex; }
.loading-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #e5e7eb;
    border-top-color: #16a34a;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.loading-text { font-size: 0.95rem; color: #374151; font-weight: 600; }

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

/* ---- Dark mode ---- */
@media (prefers-color-scheme: dark) {
    body { background: linear-gradient(160deg, #0f172a 0%, #1e293b 55%, #0f172a 100%); color: #e5e7eb; }
    .auth-container { background: #1e293b; border-color: #334155; box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
    .auth-logo { color: #e5e7eb; }
    .auth-title { color: #e5e7eb; }
    .auth-subtitle { color: #9ca3af; }
    .auth-label { color: #d1d5db; }
    .auth-input { background: #0f172a; border-color: #334155; color: #e5e7eb; }
    .auth-input:focus { border-color: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,0.2); }
    .auth-input::placeholder { color: #6b7280; }
    select.auth-input { background-color: #0f172a; }
    .auth-btn-google { background: #0f172a; color: #d1d5db; border-color: #334155; }
    .auth-btn-google:hover { background: #1e293b; border-color: #475569; }
    .auth-alert.error { background: #450a0a; color: #fca5a5; border-color: #7f1d1d; }
    .auth-alert.success { background: #052e16; color: #86efac; border-color: #14532d; }
    .auth-footer { color: #9ca3af; }
    .auth-back { color: #9ca3af; }
    .auth-back:hover { color: #16a34a; }
    .auth-divider { color: #6b7280; }
    .auth-divider::before, .auth-divider::after { background: #334155; }
    .loading-overlay { background: rgba(15,23,42,0.92); }
    .loading-spinner { border-color: #334155; border-top-color: #16a34a; }
    .loading-text { color: #d1d5db; }
    .pais-select { background-color: #0f172a; border-color: #334155; color: #d1d5db; }
    .pais-select:focus { border-color: #16a34a; }
    .tel-input-wrap input { background: #0f172a; border-color: #334155; color: #e5e7eb; }
    .tel-input-wrap input:focus { border-color: #16a34a; }
}
[data-theme="dark"] body { background: linear-gradient(160deg, #0f172a 0%, #1e293b 55%, #0f172a 100%); color: #e5e7eb; }
[data-theme="dark"] .auth-container { background: #1e293b; border-color: #334155; box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
[data-theme="dark"] .auth-logo { color: #e5e7eb; }
[data-theme="dark"] .auth-title { color: #e5e7eb; }
[data-theme="dark"] .auth-subtitle { color: #9ca3af; }
[data-theme="dark"] .auth-label { color: #d1d5db; }
[data-theme="dark"] .auth-input { background: #0f172a; border-color: #334155; color: #e5e7eb; }
[data-theme="dark"] .auth-input:focus { border-color: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,0.2); }
[data-theme="dark"] .auth-btn-google { background: #0f172a; color: #d1d5db; border-color: #334155; }
[data-theme="dark"] .auth-btn-google:hover { background: #1e293b; border-color: #475569; }
[data-theme="dark"] .auth-alert.error { background: #450a0a; color: #fca5a5; border-color: #7f1d1d; }
[data-theme="dark"] .auth-alert.success { background: #052e16; color: #86efac; border-color: #14532d; }
[data-theme="dark"] .auth-footer { color: #9ca3af; }
[data-theme="dark"] .auth-divider { color: #6b7280; }
[data-theme="dark"] .auth-divider::before, [data-theme="dark"] .auth-divider::after { background: #334155; }
[data-theme="dark"] .loading-overlay { background: rgba(15,23,42,0.92); }
[data-theme="dark"] .loading-text { color: #d1d5db; }
[data-theme="dark"] .pais-select { background-color: #0f172a; border-color: #334155; color: #d1d5db; }
[data-theme="dark"] .tel-input-wrap input { background: #0f172a; border-color: #334155; color: #e5e7eb; }
