/* ============================================================
   REGISTER.CSS
   ============================================================ */

:root {
    --purple:      #6A4691;
    --purple-dark: #5a3b7a;
    --purple-light:#f3eefb;
    --purple-mid:  #c9a8e8;
    --text:        #222;
    --text-muted:  #717171;
    --border:      #e0e0e0;
    --white:       #ffffff;
    --error:       #e53935;
    --success:     #2e7d32;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: "Questrial", sans-serif;
    background: #fafafa;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

/* ── PANEL IZQUIERDO ── */
.left-panel {
    background: linear-gradient(160deg, #6A4691 0%, #3d2259 60%, #1e0f30 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px;
    position: relative;
    overflow: hidden;
}

.left-panel::before {
    content: "";
    position: absolute;
    width: 400px; height: 400px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.08);
    top: -100px; right: -100px;
}

.left-panel::after {
    content: "";
    position: absolute;
    width: 300px; height: 300px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.06);
    bottom: 80px; left: -80px;
}

.left-logo {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    text-decoration: none;
    z-index: 1;
}

.left-logo .brand-logo-img {
    height: 72px;
    width: auto;
    object-fit: contain;
}

.left-content { z-index: 1; }

.left-content h2 {
    font-size: 2.4rem;
    font-weight: 700;
    color: white;
    line-height: 1.25;
    margin-bottom: 16px;
}

.left-content p {
    color: rgba(255,255,255,0.65);
    font-size: 1.05rem;
    line-height: 1.7;
    max-width: 340px;
}

.left-features {
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.left-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,0.8);
    font-size: 0.95rem;
}

.left-feature-icon {
    width: 36px; height: 36px;
    background: rgba(255,255,255,0.12);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* ── PANEL DERECHO ── */
.right-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    overflow-y: auto;
}

.form-container {
    width: 100%;
    max-width: 420px;
}

.form-header { margin-bottom: 32px; }

.form-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.form-header p { color: var(--text-muted); font-size: 0.95rem; }

.form-header p a {
    color: var(--purple);
    font-weight: 600;
    text-decoration: none;
}

.form-header p a:hover { text-decoration: underline; }

/* ── CAMPOS ── */
.field-group { margin-bottom: 18px; }

.field-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 7px;
    letter-spacing: 0.3px;
}

.field-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.field-icon {
    position: absolute;
    left: 14px;
    font-size: 1rem;
    color: #aaa;
    pointer-events: none;
    z-index: 1;
}

.field-input {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 13px 14px 13px 42px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text);
    background: var(--white);
    outline: none;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.field-input:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(106,70,145,0.1);
}

/* ── ESTADO ERROR ──
   Cuando JS agrega la clase "error" al input,
   el campo se pone con borde rojo y fondo rosado */
.field-input.error {
    border-color: var(--error);
    background: #fff0f0;
    box-shadow: 0 0 0 3px rgba(229,57,53,0.15);
    color: var(--error);
}

.field-input.error::placeholder {
    color: #f08080;
}

/* Dos campos en fila */
.fields-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* Toggle contraseña */
.toggle-pass {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    cursor: pointer;
    color: #aaa;
    font-size: 1rem;
    padding: 0;
    transition: color 0.2s;
}

.toggle-pass:hover { color: var(--purple); }

/* ── MENSAJE DE ERROR ──
   Oculto por defecto (display:none).
   Cuando JS agrega la clase "visible" → display:flex
   muestra el ícono ⚠ + el texto en la misma línea,
   con fondo rosado y línea roja a la izquierda */
.field-error {
    display: none;
    align-items: center;
    gap: 6px;
    color: var(--error);
    font-size: 0.82rem;
    font-weight: 700;
    margin-top: 6px;
    padding: 6px 10px;
    background: #fff0f0;
    border-radius: 6px;
    border-left: 3px solid var(--error);
}

.field-error.visible {
    display: flex;
}

.field-error::before {
    content: "⚠";
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* Indicador fuerza contraseña */
.password-strength { margin-top: 6px; display: none; }
.password-strength.visible { display: block; }

.strength-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}

.strength-fill {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: width 0.3s, background 0.3s;
}

.strength-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Checkbox términos */
.terms-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 24px;
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.terms-check input[type="checkbox"] {
    width: 17px; height: 17px;
    accent-color: var(--purple);
    margin-top: 2px;
    flex-shrink: 0;
    cursor: pointer;
}

.terms-check a { color: var(--purple); font-weight: 600; text-decoration: none; }

/* Botón principal */
.btn-submit {
    width: 100%;
    background: var(--purple);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(106,70,145,0.3);
    letter-spacing: 0.3px;
}

.btn-submit:hover {
    background: var(--purple-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(106,70,145,0.4);
}

.btn-submit:active { transform: translateY(0); }

/* Divisor */
.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: #bbb;
    font-size: 0.82rem;
    font-weight: 600;
}

.divider::before, .divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Link inferior */
.footer-link {
    text-align: center;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.footer-link a {
    color: var(--purple);
    font-weight: 600;
    text-decoration: none;
}

/* Olvidé contraseña (login) */
.forgot-row {
    display: flex;
    justify-content: flex-end;
    margin-top: -10px;
    margin-bottom: 20px;
}

.forgot-link {
    color: var(--purple);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
}

.forgot-link:hover { text-decoration: underline; }

/* Error general login */
.form-error {
    display: none;
    background: #fdecea;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--error);
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.form-error.visible { display: block; }

/* Botón secundario (login) */
.btn-register {
    width: 100%;
    background: white;
    color: var(--purple);
    border: 1.5px solid var(--purple);
    padding: 14px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    text-decoration: none;
    display: block;
}

.btn-register:hover { background: var(--purple-light); }

/* Tarjeta reseña (login) */
.left-card {
    z-index: 1;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(6px);
}

.left-card-stars {
    color: #ffc107;
    font-size: 1rem;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.left-card-text {
    color: rgba(255,255,255,0.9);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 14px;
}

.left-card-author { display: flex; align-items: center; gap: 10px; }

.left-card-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.left-card-name { color: white; font-size: 0.88rem; font-weight: 700; }
.left-card-sub  { color: rgba(255,255,255,0.55); font-size: 0.78rem; }

/* Toast */
.toast {
    display: none;
    position: fixed;
    top: 24px; right: 24px;
    background: #1b5e20;
    color: white;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.toast.visible { display: flex; align-items: center; gap: 10px; }

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Responsive */
@media (max-width: 768px) {
    body { grid-template-columns: 1fr; }
    .left-panel { display: none; }
    .right-panel { padding: 32px 24px; }
    .fields-row { grid-template-columns: 1fr; }
}
