/* =========================================================================
   Berry Card — Auth Screens (Login + Register)
   Sistema visual reutilizable para wk-form-login.php y registro/wk_form_register.php
   Depende de las variables CSS de :root definidas en styles-panel-admin.css
   ========================================================================= */

* { box-sizing: border-box; }

/* Reset mínimo: evita el margin default del body y asegura el fondo
   cream cuando styles-panel-admin.css no está cargado (p.ej. /panel/registro/). */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    background-color: var(--cream, #fefaf8);
    font-family: 'Merriweather', Georgia, serif;
    color: var(--ink, #1a1117);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.bc-auth-shell {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    background: var(--cream, #fefaf8);
    overflow: hidden;
}

/* ────────────────────────────────────────────────────────────────────────
   PANEL DE MARCA (izquierda)
   ──────────────────────────────────────────────────────────────────────── */
.bc-auth-brand {
    position: relative;
    background:
        radial-gradient(ellipse at top left, rgba(255,255,255,.18) 0%, transparent 55%),
        radial-gradient(ellipse at bottom right, rgba(0,0,0,.18) 0%, transparent 55%),
        linear-gradient(135deg, #c85a7d 0%, #a03d60 100%);
    color: #fff;
    padding: 3.5rem 3.25rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    isolation: isolate;
}

.bc-auth-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><g fill='%23ffffff' fill-opacity='0.08'><circle cx='30' cy='40' r='28'/><circle cx='160' cy='80' r='38'/><circle cx='90' cy='150' r='22'/><circle cx='170' cy='170' r='30'/><circle cx='40' cy='110' r='18'/></g></svg>");
    background-size: 320px 320px;
    background-repeat: repeat;
    z-index: -1;
    opacity: .55;
}

.bc-auth-form-logo {
    display: block;
    height: 140px;
    width: auto;
    max-width: 280px;
    margin: 0 auto 2.5rem;
    object-fit: contain;
}

.bc-auth-brand-content {
    margin-top: auto;
    margin-bottom: auto;
    max-width: 460px;
}

.bc-auth-brand-tagline {
    font-family: 'Merriweather', Georgia, serif;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 1.25rem;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0,0,0,.18);
}

.bc-auth-brand-tagline em {
    font-style: italic;
    opacity: .92;
}

.bc-auth-brand-sub {
    font-size: 1rem;
    line-height: 1.5;
    margin: 0 0 2rem;
    opacity: .9;
    max-width: 380px;
}

.bc-auth-brand-bullets {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

.bc-auth-brand-bullet {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: .98rem;
    font-weight: 500;
    opacity: .95;
}

.bc-auth-brand-bullet i {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
}

.bc-auth-brand-foot {
    margin-top: 2.5rem;
    font-size: .82rem;
    opacity: .7;
    border-top: 1px solid rgba(255,255,255,.18);
    padding-top: 1.25rem;
}

/* ────────────────────────────────────────────────────────────────────────
   WRAPPER DEL FORMULARIO (derecha)
   ──────────────────────────────────────────────────────────────────────── */
.bc-auth-form-wrap {
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--cream, #fefaf8);
    overflow-y: auto;
    gap: 0;
}

.bc-auth-card {
    width: 100%;
    max-width: 440px;
    padding: 2.5rem 2.25rem;
    background: #fff;
    border: 1px solid var(--border-soft, #e9ecef);
    border-radius: 18px;
    box-shadow:
        0 1px 2px rgba(0,0,0,.03),
        0 12px 32px -8px rgba(160, 61, 96, .12),
        0 28px 64px -16px rgba(160, 61, 96, .10);
}

.bc-auth-title {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--ink, #1a1117);
    margin: 0 0 .35rem;
    text-align: center;
    line-height: 1.2;
}

.bc-auth-sub {
    color: var(--ink-mid, #4a3540);
    font-size: .92rem;
    margin: 0 0 2rem;
    text-align: center;
}

/* ────────────────────────────────────────────────────────────────────────
   INPUT CON ICONO + LABEL FLOTANTE
   ──────────────────────────────────────────────────────────────────────── */
.bc-auth-field {
    position: relative;
    margin-bottom: 1.1rem;
}

.bc-auth-field .bc-auth-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ink-muted, #8a7080);
    font-size: 1.05rem;
    pointer-events: none;
    transition: color .2s ease;
    z-index: 2;
}

.bc-auth-field input {
    width: 100%;
    height: 56px;
    padding: 20px 52px 0 48px;
    border: 1.5px solid var(--border-soft, #e9ecef);
    border-radius: 12px;
    background: var(--cream, #fefaf8);
    font-size: .98rem;
    color: var(--ink, #1a1117);
    font-family: inherit;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
    outline: none;
}

.bc-auth-field input::placeholder {
    color: transparent;
}

.bc-auth-field input:focus {
    border-color: var(--rose, #c85a7d);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(200, 90, 125, .12);
}

.bc-auth-field input:focus + label,
.bc-auth-field input:not(:placeholder-shown) + label {
    transform: translateY(-22px) scale(.82);
    color: var(--rose, #c85a7d);
    font-weight: 600;
}

.bc-auth-field label {
    position: absolute;
    left: 48px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ink-muted, #8a7080);
    font-size: .95rem;
    pointer-events: none;
    transition: transform .2s ease, color .2s ease, font-size .2s ease;
    transform-origin: left center;
    background: transparent;
    padding: 0 4px;
    z-index: 1;
}

.bc-auth-field .bc-auth-eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--ink-muted, #8a7080);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: color .15s ease, background .15s ease;
    z-index: 3;
}

.bc-auth-field .bc-auth-eye:hover {
    color: var(--rose, #c85a7d);
    background: var(--rose-light, rgba(200, 90, 125, .10));
}

/* ────────────────────────────────────────────────────────────────────────
   VALIDACIÓN INLINE
   ──────────────────────────────────────────────────────────────────────── */
.bc-auth-field input.is-invalid {
    border-color: #dc2626;
    background: #fef2f2;
}

.bc-auth-field input.is-invalid + label {
    color: #dc2626;
}

.bc-auth-field input.is-valid {
    border-color: #16a34a;
    background: #f0fdf4;
}

.bc-auth-field input.is-valid + label {
    color: #16a34a;
}

.bc-auth-msg-inline {
    font-size: .78rem;
    margin-top: -0.75rem;
    margin-bottom: .85rem;
    padding-left: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    min-height: 18px;
}

.bc-auth-msg-inline.is-valid  { color: #15803d; }
.bc-auth-msg-inline.is-invalid { color: #b91c1c; }
.bc-auth-msg-inline i { font-size: .85rem; }

/* ────────────────────────────────────────────────────────────────────────
   BOTÓN PRINCIPAL
   ──────────────────────────────────────────────────────────────────────── */
.bc-auth-cta {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--rose, #c85a7d) 0%, var(--rose-dark, #a03d60) 100%);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .02em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    box-shadow: 0 6px 16px -4px rgba(200, 90, 125, .45);
    transition: transform .15s ease, box-shadow .15s ease, opacity .2s ease;
    margin-top: .5rem;
}

.bc-auth-cta:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px -6px rgba(200, 90, 125, .55);
}

.bc-auth-cta:active:not(:disabled) {
    transform: translateY(0);
}

.bc-auth-cta:disabled {
    opacity: .7;
    cursor: not-allowed;
}

.bc-auth-cta .bc-auth-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: bc-auth-spin .8s linear infinite;
}

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

.bc-auth-cta.is-loading .bc-auth-spinner { display: inline-block; }
.bc-auth-cta.is-loading .bc-auth-cta-text { opacity: .7; }

/* ────────────────────────────────────────────────────────────────────────
   MENSAJE GLOBAL / FOOTER DEL CARD
   ──────────────────────────────────────────────────────────────────────── */
.bc-auth-message {
    margin: 1rem 0;
    min-height: 0;
}

.bc-auth-message > div {
    padding: .7rem 1rem;
    border-radius: 10px;
    font-size: .88rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bc-auth-message .bg-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid rgba(22,163,74,.25);
}

.bc-auth-message .bg-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid rgba(217,119,6,.25);
}

.bc-auth-message .bg-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid rgba(220,38,38,.25);
}

.bc-auth-link-row {
    text-align: right;
    margin: -.65rem 0 1.1rem;
}

.bc-auth-link-row a {
    font-size: .82rem;
    color: var(--rose, #c85a7d);
    text-decoration: none;
    font-weight: 500;
}

.bc-auth-link-row a:hover {
    color: var(--rose-dark, #a03d60);
    text-decoration: underline;
}

.bc-auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 1.5rem 0 1rem;
    color: var(--ink-muted, #8a7080);
    font-size: .82rem;
}

.bc-auth-divider::before,
.bc-auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-soft, #e9ecef);
}

.bc-auth-alt {
    text-align: center;
    color: var(--ink-mid, #4a3540);
    font-size: .9rem;
    margin: 1rem 0 0;
}

.bc-auth-alt a {
    color: var(--rose, #c85a7d);
    font-weight: 700;
    text-decoration: none;
}

.bc-auth-alt a:hover {
    color: var(--rose-dark, #a03d60);
    text-decoration: underline;
}

/* ────────────────────────────────────────────────────────────────────────
   RESPONSIVE — Mobile / Tablet
   ──────────────────────────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .bc-auth-shell {
        grid-template-columns: 1fr;
    }

    .bc-auth-brand {
        padding: 1rem 1.5rem 0.75rem;
        min-height: 100px;
    }

    .bc-auth-brand-content {
        margin: 0;
        display: flex;
        align-items: center;
        gap: 0.75rem;
        flex-wrap: wrap;
    }

    .bc-auth-form-logo {
        height: 120px;
        margin-bottom: 1.75rem;
    }

    .bc-auth-brand-tagline {
        font-size: 1rem;
        margin: 0;
    }

    .bc-auth-brand-sub,
    .bc-auth-brand-bullets,
    .bc-auth-brand-foot {
        display: none;
    }

    .bc-auth-form-wrap {
        padding: 1.5rem 1rem 2rem;
    }

    .bc-auth-card {
        padding: 1.75rem 1.5rem;
        box-shadow:
            0 1px 2px rgba(0,0,0,.03),
            0 8px 24px -8px rgba(160, 61, 96, .15);
    }

    .bc-auth-title {
        font-size: 1.35rem;
    }

    .bc-auth-sub {
        font-size: .85rem;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 575.98px) {
    .bc-auth-card {
        padding: 1.5rem 1.25rem;
        border-radius: 14px;
    }

    .bc-auth-field input {
        height: 52px;
        font-size: .95rem;
    }

    .bc-auth-cta {
        height: 48px;
        font-size: .95rem;
    }

    .bc-auth-form-logo {
        height: 96px;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 380px) {
    .bc-auth-brand {
        padding: 1.25rem 1rem 1rem;
        min-height: 140px;
    }
    .bc-auth-brand-tagline {
        font-size: 1rem;
    }
}

/* ────────────────────────────────────────────────────────────────────────
   ACCESIBILIDAD — reduced motion
   ──────────────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .bc-auth-cta,
    .bc-auth-field input,
    .bc-auth-field label,
    .bc-auth-field .bc-auth-icon {
        transition: none !important;
    }
    .bc-auth-cta .bc-auth-spinner {
        animation-duration: 1.6s;
    }
}
