/* Login Konoyek — estilo split card con colores de marca */

:root {
    --k-purple-deep: #4a3568;
    --k-purple: #6b4fa0;
    --k-purple-light: #8b6bb8;
    --k-purple-soft: #c4b5fd;
    --k-purple-pale: #ede9fe;
    --k-purple-glow: rgba(107, 79, 160, 0.35);
    --k-text: #1f2937;
    --k-muted: #9ca3af;
    --k-panel-bg: #f3f4f8;
    --k-card-shadow: 0 30px 80px rgba(74, 53, 104, 0.22);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body.auth-page {
    margin: 0;
    min-height: 100%;
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
    color: var(--k-text);
}

body.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
    background:
        linear-gradient(135deg, var(--k-purple-deep) 0%, #5a4085 38%, transparent 38%),
        linear-gradient(225deg, #ddd6fe 0%, #f5f3ff 45%, #faf5ff 100%);
    background-color: #ece8f4;
}

.auth-page-wrap {
    width: min(920px, 100%);
}

.auth-shell {
    display: grid;
    grid-template-columns: 0.92fr 1.08fr;
    min-height: 560px;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: var(--k-card-shadow);
    background: #fff;
}

/* ── Panel izquierdo ── */
.auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2.25rem 2rem 1.75rem;
    overflow: hidden;
    background:
        radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.12), transparent 42%),
        radial-gradient(circle at 85% 80%, rgba(0, 0, 0, 0.12), transparent 40%),
        linear-gradient(160deg, #5c4388 0%, #6b4fa0 45%, #7d5eb8 100%);
    color: #fff;
}

.auth-brand__ambient {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.auth-brand__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.45;
    animation: auth-orb-float 10s ease-in-out infinite;
}

.auth-brand__orb--1 {
    width: 180px;
    height: 180px;
    top: 10%;
    left: -20%;
    background: rgba(196, 181, 253, 0.35);
}

.auth-brand__orb--2 {
    width: 140px;
    height: 140px;
    bottom: 15%;
    right: -15%;
    background: rgba(244, 114, 182, 0.22);
    animation-delay: -3s;
    animation-duration: 12s;
}

.auth-brand__orb--3 {
    width: 100px;
    height: 100px;
    top: 45%;
    left: 55%;
    background: rgba(129, 140, 248, 0.25);
    animation-delay: -6s;
    animation-duration: 14s;
}

@keyframes auth-orb-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(12px, -18px) scale(1.06); }
    66% { transform: translate(-8px, 10px) scale(0.96); }
}

.auth-brand__head {
    position: relative;
    z-index: 2;
}

.auth-brand__logo {
    display: block;
    width: min(200px, 72%);
    margin-bottom: 0;
    filter: brightness(0) invert(1);
}

.auth-brand__visual {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 0;
    position: relative;
    z-index: 1;
    perspective: 900px;
}

.auth-visual {
    position: relative;
    width: 240px;
    height: 240px;
    transform-style: preserve-3d;
    transition: transform 0.1s linear;
    will-change: transform;
}

.auth-visual__glow {
    position: absolute;
    inset: 20%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.18) 0%, transparent 70%);
    animation: auth-glow-pulse 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes auth-glow-pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.08); }
}

.auth-visual__ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.18);
    transition: transform 0.2s ease;
}

.auth-visual__ring--outer {
    inset: 0;
    animation: auth-ring-spin 48s linear infinite;
}

.auth-visual__ring--inner {
    inset: 28px;
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(4px);
}

.auth-visual__ring--pulse {
    animation: auth-ring-pulse 3.5s ease-in-out infinite;
}

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

@keyframes auth-ring-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.08); }
    50% { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.04); }
}

/* Órbitas */
.auth-visual__orbit {
    position: absolute;
    inset: 0;
    transform-origin: center center;
    pointer-events: none;
}

.auth-visual__orbit--1 { animation: auth-orbit-a 18s linear infinite; }
.auth-visual__orbit--2 { animation: auth-orbit-b 24s linear infinite reverse; }
.auth-visual__orbit--3 { animation: auth-orbit-c 21s linear infinite; }
.auth-visual__orbit--4 { animation: auth-orbit-d 27s linear infinite reverse; }

@keyframes auth-orbit-a { to { transform: rotate(360deg); } }
@keyframes auth-orbit-b { to { transform: rotate(360deg); } }
@keyframes auth-orbit-c { to { transform: rotate(360deg); } }
@keyframes auth-orbit-d { to { transform: rotate(360deg); } }

.auth-visual__core {
    position: absolute;
    inset: 72px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    color: #fff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    animation: auth-core-float 5s ease-in-out infinite;
    z-index: 2;
}

.auth-visual__core-ring {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    animation: auth-core-ring 3s ease-in-out infinite;
}

@keyframes auth-core-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes auth-core-ring {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.06); opacity: 1; }
}

.auth-visual__dots {
    position: absolute;
    inset: 28px;
    animation: auth-orbit-a 14s linear infinite;
    pointer-events: none;
}

.auth-visual__dot {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

.auth-visual__dot--1 { width: 10px; height: 10px; top: 0; left: 50%; margin-left: -5px; animation: auth-dot-pulse 2s ease-in-out infinite; }
.auth-visual__dot--2 { width: 8px; height: 8px; top: 6px; left: calc(50% + 16px); opacity: 0.75; animation: auth-dot-pulse 2s ease-in-out 0.3s infinite; }
.auth-visual__dot--3 { width: 6px; height: 6px; top: 14px; left: calc(50% + 28px); opacity: 0.55; animation: auth-dot-pulse 2s ease-in-out 0.6s infinite; }
.auth-visual__dot--4 { width: 4px; height: 4px; top: 22px; left: calc(50% + 36px); opacity: 0.4; animation: auth-dot-pulse 2s ease-in-out 0.9s infinite; }

@keyframes auth-dot-pulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

.auth-visual__bar {
    position: absolute;
    top: -22px;
    left: 50%;
    width: 44px;
    height: 44px;
    margin-left: -22px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
    pointer-events: auto;
    cursor: default;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease, filter 0.35s ease;
}

.auth-visual__orbit--1 .auth-visual__bar { animation: auth-bar-counter-a 18s linear infinite; }
.auth-visual__orbit--2 .auth-visual__bar { animation: auth-bar-counter-b 24s linear infinite reverse; }
.auth-visual__orbit--3 .auth-visual__bar { animation: auth-bar-counter-c 21s linear infinite; }
.auth-visual__orbit--4 .auth-visual__bar { animation: auth-bar-counter-d 27s linear infinite reverse; }

@keyframes auth-bar-counter-a { to { transform: rotate(-360deg); } }
@keyframes auth-bar-counter-b { to { transform: rotate(-360deg); } }
@keyframes auth-bar-counter-c { to { transform: rotate(-360deg); } }
@keyframes auth-bar-counter-d { to { transform: rotate(-360deg); } }

.auth-visual__bar--1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.auth-visual__bar--2 { background: linear-gradient(135deg, #f472b6, #ec4899); }
.auth-visual__bar--3 { background: linear-gradient(135deg, #818cf8, #6366f1); }
.auth-visual__bar--4 { background: linear-gradient(135deg, #34d399, #10b981); }

.auth-visual__bar.is-hovered,
.auth-visual__bar:hover {
    transform: scale(1.18) !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35), 0 0 20px rgba(255, 255, 255, 0.15);
    filter: brightness(1.1);
    z-index: 5;
}

[data-hero-depth] {
    transition: transform 0.08s linear;
    will-change: transform;
}

.auth-brand__foot {
    position: relative;
    z-index: 2;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.5;
}

/* ── Panel derecho ── */
.auth-main {
    background: var(--k-panel-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 2rem;
}

.auth-panel {
    width: min(340px, 100%);
}

.auth-panel__head {
    margin-bottom: 2rem;
}

.auth-panel__logo-mobile {
    display: none;
    width: 150px;
    margin-bottom: 1.25rem;
    filter: none;
}

.auth-tabs {
    display: flex;
    gap: 1.75rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.15rem;
}

.auth-tabs__item {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--k-muted);
    padding-bottom: 0.65rem;
    position: relative;
}

.auth-tabs__item--active {
    color: var(--k-text);
    font-weight: 700;
}

.auth-tabs__item--active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: var(--k-purple);
    border-radius: 2px;
}

/* ── Formulario ── */
.auth-form {
    display: grid;
    gap: 1.5rem;
}

.auth-form .form-group,
.auth-form .input {
    margin-bottom: 0;
}

.auth-field--line {
    display: grid;
    gap: 0.35rem;
}

.auth-field__label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #374151;
}

.auth-field__input,
.auth-form .form-control {
    width: 100%;
    height: auto;
    padding: 0.45rem 0 0.55rem !important;
    border: 0 !important;
    border-bottom: 1.5px solid #d1d5db !important;
    border-radius: 0 !important;
    background: transparent !important;
    font-size: 0.92rem !important;
    color: var(--k-text) !important;
    box-shadow: none !important;
    transition: border-color 0.2s ease;
}

.auth-field__input:focus,
.auth-form .form-control:focus {
    outline: none;
    border-bottom-color: var(--k-purple) !important;
    box-shadow: none !important;
}

.auth-field__input::placeholder {
    color: #c4c9d4;
    font-weight: 400;
}

.auth-submit {
    margin-top: 0.75rem;
    width: 100%;
    height: 48px;
    border: 0;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--k-purple-deep) 0%, var(--k-purple) 100%);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 8px 24px var(--k-purple-glow);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.auth-submit:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
    box-shadow: 0 12px 28px rgba(107, 79, 160, 0.42);
}

.auth-submit:active {
    transform: translateY(0);
}

.auth-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    margin-top: 2.5rem;
    padding-top: 1.25rem;
}

.auth-contact__item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--k-muted);
    text-decoration: none;
}

.auth-contact__item i {
    font-size: 0.95rem;
    color: var(--k-purple-light);
}

.auth-contact__item:hover {
    color: var(--k-purple);
}

/* Flash messages */
body.auth-page .message,
body.auth-page .alert {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    min-width: min(420px, calc(100vw - 2rem));
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

@media (max-width: 820px) {
    body.auth-page {
        padding: 1rem;
        background: var(--k-panel-bg);
    }

    .auth-shell {
        grid-template-columns: 1fr;
        min-height: auto;
        border-radius: 20px;
    }

    .auth-brand {
        display: none;
    }

    .auth-main {
        padding: 2rem 1.5rem;
    }

    .auth-panel__logo-mobile {
        display: block;
    }
}

@media (max-width: 420px) {
    .auth-main {
        padding: 1.5rem 1.1rem;
    }

    .auth-tabs__item {
        font-size: 0.95rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-visual__orbit,
    .auth-visual__orbit .auth-visual__bar,
    .auth-visual__dots,
    .auth-visual__ring--outer,
    .auth-visual__core,
    .auth-visual__core-ring,
    .auth-visual__glow,
    .auth-brand__orb,
    .auth-visual__dot {
        animation: none !important;
    }

    [data-hero-depth],
    .auth-visual {
        transform: none !important;
        transition: none !important;
    }
}
