﻿/* ---------- Animaciones ---------- */
@keyframes fade {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(18px)
    }

    to {
        opacity: 1;
        transform: none
    }
}

@keyframes riseScale {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.98)
    }

    to {
        opacity: 1;
        transform: none
    }
}

/* ---------- Variables ---------- */
:root {
    /* Marca */
    --brand: #800020;
    --brand-2: #a1002d;

    /* Paleta vino dominante */
    --vino-400: #8f2746;
    /* medio */
    --vino-500: #6d0f2f;
    /* principal */
    --vino-600: #530a23;
    /* profundo */

    /* Base y misc */
    --bg: #fcfbfc;
    /* fondo casi blanco (neutro, sin rosa) */
    --text: #1f2937;
    --muted: #667085;
    --card: #ffffff;
    --radius: 16px;
    --shadow: 0 20px 40px rgba(16, 24, 40, .06), 0 4px 18px rgba(16, 24, 40, .06);
    --ring: 0 0 0 4px rgb(128 0 32 / .18);
}

/* ---------- Base & topbar ---------- */
body.register-body.v2 {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
    color: var(--text);
    /* velos MUY sutiles en vino, sin rosa */
    background:
        radial-gradient(70vmax 70vmax at -10% 120%, rgba(109, 15, 47, .10) 0%, transparent 60%),
        radial-gradient(70vmax 70vmax at 110% -10%, rgba(143, 39, 70, .10) 0%, transparent 60%),
        linear-gradient(135deg, #ffffff, var(--bg));

    animation: fade .4s ease;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    color: #3d0f1c;
    /* texto vino oscuro */
    font-weight: 600;
    background: #ffffff;
    background-image: url("https://www.transparenttextures.com/patterns/squared-metal.png");
    /* topbar blanco, limpio */
    border-bottom: 1px solid #e2bac6;
    /* línea vino muy suave */
}

.topbar__brand {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand), var(--brand-2));
    color: #fff;
    letter-spacing: .3px;
    box-shadow: 0 6px 18px rgba(128, 0, 32, .25);
}

.topbar__cta a {
    color: var(--vino-500);
    font-weight: 800;
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

.topbar__cta a:hover {
    border-bottom-color: var(--vino-500)
}

/* ---------- Shell (casi pantalla completa) ---------- */
.shell {
    min-height: calc(100vh - 56px);
    display: grid;
    gap: 0;
    grid-template-columns: clamp(260px, 22vw, 340px) 1fr;
    /* panel delgado + form amplio */
}

@media (max-width:1100px) {
    .shell {
        grid-template-columns: 1fr
    }
}

/* ---------- Panel decorativo izquierdo (vinotinto) ---------- */
.panel {
    position: relative;
    padding: 48px 36px;
    overflow: hidden;
    background: linear-gradient(180deg, var(--vino-500) 0%, var(--vino-600) 85%);
    color: #f8ecf0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel__content {
    max-width: 400px;
    animation: slideUp .5s ease
}

.panel__content h2 {
    margin: 0 0 10px;
    font-size: clamp(24px, 2.6vw, 34px)
}

.panel__content p {
    margin: 0 0 16px;
    color: #f2dbe2
}

.panel__content ul {
    margin: 0;
    padding-left: 18px;
    color: #f2dbe2
}

.panel__content li {
    margin: 6px 0
}

/* Formas decorativas claras (sin cian/rosas) */
.shapes {
    position: absolute;
    inset: -20% -10% -25% -10%;
    background:
        conic-gradient(from 140deg at 20% 20%, rgba(255, 255, 255, .22), transparent 35%),
        conic-gradient(from -30deg at 80% 30%, rgba(255, 255, 255, .08), transparent 40%),
        radial-gradient(460px 460px at 60% 85%, rgba(255, 255, 255, .06), transparent 60%);
    mix-blend-mode: soft-light;
    pointer-events: none;
}

/* ---------- Card del formulario (derecha) ---------- */
.card {
    background: var(--card);
    background-image: url("https://www.transparenttextures.com/patterns/large-leather.png");
    border-top-left-radius: 28px;
    border-bottom-left-radius: 28px;
    padding: 36px 32px;
    box-shadow: 0 12px 26px rgba(16, 24, 40, .08), 0 2px 10px rgba(16, 24, 40, .06);
    animation: riseScale .45s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-left: 1px solid #ead0d7;
    /* separación sutil */
}

@media (max-width:1100px) {
    .card {
        border-radius: 0;
        min-height: calc(100vh - 56px)
    }
}

.card__header {
    text-align: center
}

.logo {
    width: 92px;
    height: auto;
    display: block;
    margin: 0 auto 6px
}

.card__header h1 {
    margin: 8px 0 4px;
    color: var(--brand)
}

.subtitle {
    margin: 0 0 12px;
    color: #475467
}

/* mensajes */
.error-message {
    background: #ffe8ea;
    color: #6a1024;
    border: 1px solid #f7c0c6;
    padding: 10px 12px;
    border-radius: 12px;
    margin: 12px auto 6px;
    font-weight: 600;
    max-width: 960px;
}

/* ---------- Form ---------- */
.register-form {
    margin: 8px auto 0;
    width: 100%;
    max-width: 1000px
}

.form-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(280px, 420px));
    column-gap: 40px;
    row-gap: 14px;
    justify-content: center;
}

.form-grid .input-group {
    min-width: 0
}

.span-2 {
    grid-column: span 2
}

@media (max-width:780px) {
    .form-grid {
        grid-template-columns: 1fr
    }

    .span-2 {
        grid-column: auto
    }
}

.input-group label {
    display: block;
    margin: 0 0 6px;
    font-weight: 800;
    font-size: 14px;
    color: #344054;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1.6px solid #E5E7EB;
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    outline: none;
    transition: border .15s, box-shadow .15s;
    font-size: 15px;
}

.input-group input:focus,
.input-group select:focus {
    border-color: var(--brand);
    box-shadow: var(--ring)
}

.input-group input::placeholder {
    color: #9aa2b1
}

/* Dropzone PDF */
.input-group--file .dropzone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    padding: 16px;
    border: 2px dashed #E5E7EB;
    border-radius: 12px;
    background: #fafafa;
    cursor: pointer;
    transition: border-color .2s, background .2s;
}

.input-group--file .dropzone:hover {
    border-color: var(--brand);
    background: #fff0f4
}

.dropzone input[type="file"] {
    display: none
}

.file-preview {
    display: block;
    margin-top: 6px;
    color: #475467;
    font-size: 13px;
    font-style: italic
}

/* Toggle contraseña */
.toggle-password-container {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    align-items: center;
    color: #475467
}

/* Botón */
.register-button {
    margin: 16px auto 0;
    width: 100%;
    max-width: 1000px;
    padding: 14px 16px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(90deg, var(--brand), var(--brand-2));
    color: #fff;
    font-weight: 900;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(128, 0, 32, .22);
    transition: transform .05s, filter .15s, box-shadow .15s;
}

.register-button:hover {
    filter: saturate(1.06);
    box-shadow: 0 16px 32px rgba(128, 0, 32, .28)
}

.register-button:active {
    transform: translateY(1px)
}

/* link alternativo */
.alt-login {
    margin: 12px auto 0;
    text-align: center;
    color: #475467
}

.alt-login a {
    color: var(--brand);
    font-weight: 800;
    text-decoration: none
}

.alt-login a:hover {
    text-decoration: underline
}

/* Footer */
.register-footer {
    background: #ffffff;
    background-image: url("https://www.transparenttextures.com/patterns/squared-metal.png");
    border-top: 1px solid #e2bac6;
    color: #3d0f1c;
    text-align: center;
    padding: 12px;
}


/*---------------------------*/
/* 1) Enfoque visible y consistente */
.input-group input:focus-visible,
.input-group select:focus-visible {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(128, 0, 32, .22);
}

/* 2) Validación amable (no “rojo” mientras el campo está vacío) */
.input-group input:invalid:not(:placeholder-shown):not(:focus),
.input-group select:invalid:not(:focus) {
    border-color: #d92d20;
    box-shadow: 0 0 0 3px rgba(217, 45, 32, .12);
}

/* 3) Dropzone: resaltar cuando hay arrastre */
.input-group--file .dropzone.dragover {
    border-color: var(--brand-2);
    background: #fff5f8;
    box-shadow: 0 0 0 3px rgba(128, 0, 32, .12) inset;
}

/* 4) Mejor contraste en el panel (texto 100% blanco) */
.panel__content h2 {
    color: #fff;
}

.panel__content p,
.panel__content ul {
    color: #f7e8ec;
}

/* 5) Respeta usuarios con reducción de movimiento */
@media (prefers-reduced-motion: reduce) {
    .register-body.v2 * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}


/* Mensajes inline y estados de campo */
.field-msg {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.25;
    color: #b42318;
    /* rojo accesible */
}

.input-invalid {
    border-color: #d92d20 !important;
    box-shadow: 0 0 0 3px rgba(217, 45, 32, .12) !important;
}

.input-valid {
    border-color: #8fd3a8;
    /* verde suave */
    box-shadow: 0 0 0 2px rgba(16, 185, 129, .14);
}

.hstack {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-secondary {
    padding: 10px 12px;
    border: 1px solid #d7c2c9;
    border-radius: 10px;
    background: #fff;
    color: #6d0f2f;
    font-weight: 700;
    cursor: pointer;
}

.btn-secondary:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.hint {
    color: #6b4a58;
    font-size: 12px;
}


/*-----------------------------------------------------*/
/* ===== Toasts ===== */
.toast-container {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 260px;
    max-width: 360px;
    padding: 12px 14px;
    border-radius: 12px;
    color: #fff;
    background: #6d0f2f;
    /* vino */
    box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
    display: flex;
    gap: 10px;
    align-items: flex-start;
    opacity: 0;
    transform: translateY(-10px);
    animation: toast-in .18s ease-out forwards;
}

.toast--success {
    background: #12a150;
}

.toast--error {
    background: #d13658;
}

.toast--info {
    background: #6d0f2f;
}

.toast__close {
    margin-left: auto;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    opacity: .9;
}

@keyframes toast-in {
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* ===== Spinner en botones ===== */
button.is-loading {
    position: relative;
    pointer-events: none;
    opacity: .92;
}

button.is-loading::after {
    content: "";
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-top-color: transparent;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}