/* =================================================================
   4K INTERNATIONAL CORP — LOGIN
   Editorial premium · Coaching, mentoring & franquicias
   ================================================================= */

:root {
    /* === Paleta === */
    --bg-darkest:   #08080c;
    --bg-dark:      #0e0e15;
    --bg-card:      rgba(22, 22, 31, 0.55);

    --gold:         #c9a961;
    --gold-light:   #e4c97e;
    --gold-deep:    #8a7340;
    --gold-faint:   rgba(201, 169, 97, 0.12);

    --text-primary:   #f5f1e8;
    --text-secondary: #a8a39a;
    --text-muted:     #6b6661;

    --line:        rgba(201, 169, 97, 0.12);
    --line-strong: rgba(201, 169, 97, 0.3);

    /* === Tipografías === */
    --font-display: 'Fraunces', 'Times New Roman', serif;
    --font-body:    'Manrope', system-ui, sans-serif;

    /* === Curvas de animación === */
    --ease-out:   cubic-bezier(0.22, 1, 0.36, 1);
    --ease-soft:  cubic-bezier(0.34, 1.26, 0.64, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* =================================================================
   RESET + BASE
   ================================================================= */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    background: var(--bg-darkest);
    color: var(--text-primary);
    position: relative;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    letter-spacing: 0.01em;
}

/* Selección de texto */
::selection { background: var(--gold); color: var(--bg-darkest); }

/* Foco accesible */
:focus-visible {
    outline: 1px solid var(--gold);
    outline-offset: 3px;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* =================================================================
   FONDO — Canvas, grid, resplandores
   ================================================================= */
#networkCanvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.75;
}

.grid-overlay {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
    background-size: 80px 80px;
    mask-image: radial-gradient(ellipse at center, black 25%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 25%, transparent 80%);
    pointer-events: none;
    z-index: 0;
}

.glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    pointer-events: none;
    z-index: 0;
}

.glow-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(201, 169, 97, 0.12), transparent 70%);
    top: -200px;
    left: -150px;
    animation: glowDrift 20s var(--ease-in-out) infinite;
}

.glow-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(74, 144, 226, 0.08), transparent 70%);
    bottom: -150px;
    right: -100px;
    animation: glowDrift 25s var(--ease-in-out) infinite reverse;
}

@keyframes glowDrift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(60px, -40px) scale(1.1); }
}

/* Grano sutil */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0.25;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* =================================================================
   TOP NAV
   ================================================================= */
.top-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 50;
    padding: 1.5rem clamp(1.25rem, 3vw, 3rem);
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: fadeDown 1s var(--ease-out) 0.2s both;
}

@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    color: var(--text-primary);
    transition: opacity 0.3s;
}
.brand:hover { opacity: 0.85; }

.brand-logo {
    display: flex;
    align-items: baseline;
    font-family: var(--font-display);
    font-weight: 300;
    font-variation-settings: 'opsz' 144, 'SOFT' 30;
    font-size: 2rem;
    line-height: 1;
    letter-spacing: -0.05em;
}

.logo-letter--k {
    color: var(--gold);
    font-style: italic;
    font-weight: 400;
    font-variation-settings: 'opsz' 144, 'SOFT' 100;
}

.brand-divider {
    width: 1px;
    height: 28px;
    background: var(--line-strong);
}

.brand-text { line-height: 1.1; }

.brand-name {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.25em;
    color: var(--text-primary);
}

.brand-sub {
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.28em;
    color: var(--gold);
    margin-top: 4px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 1rem;
    border: 1px solid var(--line);
    border-radius: 99px;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
}

.status-dot {
    width: 6px;
    height: 6px;
    background: var(--gold);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--gold);
    animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.85); }
}

.nav-link-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
    padding: 0.55rem 1rem;
    border: 1px solid var(--line);
    border-radius: 99px;
    transition: all 0.3s var(--ease-out);
}
.nav-link-back:hover {
    color: var(--gold);
    border-color: var(--line-strong);
    background: var(--gold-faint);
}
.nav-link-back i {
    font-size: 0.7rem;
    transition: transform 0.3s var(--ease-out);
}
.nav-link-back:hover i { transform: translate(2px, -2px); }

/* =================================================================
   LAYOUT
   ================================================================= */
.auth-container {
    position: relative;
    z-index: 5;
    min-height: 100vh;
    padding-top: 6rem;
    padding-bottom: 2rem;
}

.main-row { min-height: calc(100vh - 8rem); }

/* =================================================================
   LADO IZQUIERDO — HERO STORYTELLING
   ================================================================= */
.hero-side {
    padding: 3rem clamp(2rem, 4vw, 5rem);
    align-items: center;
    justify-content: flex-start;
    position: relative;
}

.hero-content {
    max-width: 560px;
    width: 100%;
    animation: fadeUp 1.1s var(--ease-out) 0.3s both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hero-eyebrow {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 1.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}
.hero-eyebrow::before {
    content: '';
    width: 32px;
    height: 1px;
    background: var(--gold);
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 300;
    font-variation-settings: 'opsz' 144, 'SOFT' 50;
    font-size: clamp(2.8rem, 5vw, 5rem);
    line-height: 0.95;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin: 0 0 2rem;
}

.title-static { display: block; }

.title-rotator {
    display: block;
    height: 1.1em;
    overflow: hidden;
    position: relative;
}

.title-rotator .word {
    position: absolute;
    left: 0;
    font-style: italic;
    font-weight: 400;
    font-variation-settings: 'opsz' 144, 'SOFT' 100;
    color: var(--gold);
    transform: translateY(110%);
    opacity: 0;
    transition:
        transform 0.85s var(--ease-soft),
        opacity 0.6s var(--ease-out);
    will-change: transform, opacity;
}

.title-rotator .word.is-active {
    transform: translateY(0);
    opacity: 1;
}

.title-rotator .word.is-leaving {
    transform: translateY(-110%);
    opacity: 0;
}

.hero-lead {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-secondary);
    max-width: 500px;
    margin-bottom: 3.5rem;
    font-weight: 300;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    padding: 2rem 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    max-width: 500px;
    margin-bottom: 2.5rem;
}

.stat {
    padding: 0 1.25rem 0 0;
    position: relative;
}
.stat:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 15%;
    bottom: 15%;
    width: 1px;
    background: var(--line);
}
.stat:not(:first-child) { padding-left: 1.25rem; }

.stat-num {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 400;
    font-variation-settings: 'opsz' 96, 'SOFT' 80;
    font-size: 2.4rem;
    color: var(--gold);
    line-height: 1;
    letter-spacing: -0.025em;
}

.stat-label {
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 0.7rem;
}

/* Quote */
.hero-quote {
    max-width: 500px;
    position: relative;
    padding-left: 1.5rem;
}

.quote-icon {
    position: absolute;
    left: 0;
    top: 4px;
    color: var(--gold);
    font-size: 0.85rem;
    opacity: 0.7;
}

.quote-text {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 300;
    font-variation-settings: 'opsz' 36, 'SOFT' 80;
    font-size: 1.05rem;
    line-height: 1.55;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.quote-author {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0;
}

/* =================================================================
   LADO DERECHO — AUTH FORM
   ================================================================= */
.auth-side {
    padding: 2rem clamp(1.25rem, 3vw, 3rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.auth-card-wrap {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.auth-card {
    position: relative;
    width: 100%;
    padding: 3rem 2.75rem;
    background: var(--bg-card);
    backdrop-filter: blur(24px) saturate(140%);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    border: 1px solid var(--line);
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    animation: cardIn 1.1s var(--ease-out) 0.5s both;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(24px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Esquinas decorativas */
.corner {
    position: absolute;
    width: 14px;
    height: 14px;
    border: 1px solid var(--gold);
    pointer-events: none;
}
.corner-tl { top: -1px;  left: -1px;  border-right:  none; border-bottom: none; }
.corner-tr { top: -1px;  right: -1px; border-left:   none; border-bottom: none; }
.corner-bl { bottom: -1px; left: -1px;  border-right: none; border-top:    none; }
.corner-br { bottom: -1px; right: -1px; border-left:  none; border-top:    none; }

/* Header */
.auth-header { margin-bottom: 2.5rem; }

.auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--gold);
    margin: 0 0 1.25rem;
}
.auth-eyebrow::before {
    content: '';
    width: 24px;
    height: 1px;
    background: var(--gold);
}

.auth-title {
    font-family: var(--font-display);
    font-weight: 300;
    font-variation-settings: 'opsz' 96, 'SOFT' 60;
    font-size: 2.4rem;
    line-height: 1.05;
    letter-spacing: -0.025em;
    color: var(--text-primary);
    margin: 0 0 0.85rem;
}
.auth-title em {
    font-style: italic;
    font-weight: 400;
    font-variation-settings: 'opsz' 96, 'SOFT' 100;
    color: var(--gold);
}

.auth-sub {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 300;
}

/* =================================================================
   FORM FIELDS — Inputs flotantes
   ================================================================= */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
}

.field { position: relative; }

.floating {
    position: relative;
    display: block;
    cursor: text;
}

.field-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    padding: 1.25rem 2rem 0.6rem 2rem;
    outline: none;
    transition: border-color 0.3s;
    letter-spacing: 0.01em;
}
.field-input::placeholder { color: transparent; }

.field-label {
    position: absolute;
    left: 2rem;
    top: 1.2rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    pointer-events: none;
    transition: all 0.4s var(--ease-out);
    letter-spacing: 0.01em;
    font-weight: 300;
}

.field-input:focus + .field-label,
.field-input:not(:placeholder-shown) + .field-label {
    top: -2px;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--gold);
}

.field-icon {
    position: absolute;
    left: 0;
    top: 1.3rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color 0.3s, transform 0.3s;
}

.floating:hover .field-icon,
.field-input:focus ~ .field-icon {
    color: var(--gold);
}

.field-line {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    transition: width 0.6s var(--ease-out);
    box-shadow: 0 0 8px rgba(201, 169, 97, 0.4);
}

.field-input:focus ~ .field-line { width: 100%; }

.toggle-vis {
    position: absolute;
    right: 0;
    top: 1.15rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    padding: 0;
    transition: color 0.3s;
}
.toggle-vis:hover { color: var(--gold); }

/* =================================================================
   FORM ROW — Remember + Forgot
   ================================================================= */
.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
}

.check {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    user-select: none;
}
.check input { display: none; }

.check-mark {
    width: 16px;
    height: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    transition: all 0.25s var(--ease-out);
}

.check input:checked ~ .check-mark {
    background: var(--gold);
    border-color: var(--gold);
    box-shadow: 0 0 12px rgba(201, 169, 97, 0.4);
}
.check input:checked ~ .check-mark::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid var(--bg-darkest);
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}

.check-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.link-forgot {
    font-size: 0.8rem;
    color: var(--text-secondary);
    position: relative;
    transition: color 0.3s;
}
.link-forgot::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 1px;
    background: var(--gold);
    transition: width 0.35s var(--ease-out);
}
.link-forgot:hover { color: var(--gold); }
.link-forgot:hover::after { width: 100%; }

/* =================================================================
   BOTÓN PRINCIPAL
   ================================================================= */
.btn-auth {
    position: relative;
    display: block;
    width: 100%;
    margin-top: 0.5rem;
    padding: 1.1rem 1.5rem;
    background: var(--gold);
    color: var(--bg-darkest);
    border: none;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    overflow: hidden;
    transition:
        transform 0.3s var(--ease-out),
        box-shadow 0.4s var(--ease-out),
        background 0.4s var(--ease-out);
}

.btn-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
}

.btn-arrow {
    font-size: 0.85rem;
    transition: transform 0.45s var(--ease-out);
}

.btn-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.35) 50%,
        transparent 100%
    );
    transition: left 0.9s var(--ease-out);
    pointer-events: none;
}

.btn-auth:hover {
    background: var(--gold-light);
    transform: translateY(-2px);
    box-shadow:
        0 14px 35px rgba(201, 169, 97, 0.35),
        0 0 60px rgba(201, 169, 97, 0.15);
}
.btn-auth:hover .btn-arrow { transform: translateX(5px); }
.btn-auth:hover .btn-shimmer { left: 100%; }

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

.btn-auth:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* =================================================================
   DIVIDER & FOOTER
   ================================================================= */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin: 2.25rem 0 1.5rem;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}
.auth-divider span {
    font-family: var(--font-display);
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-variation-settings: 'opsz' 24, 'SOFT' 80;
}

.auth-footer-text {
    text-align: center;
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 300;
}
.auth-footer-text a {
    color: var(--gold);
    font-weight: 500;
    position: relative;
    transition: text-shadow 0.3s;
}
.auth-footer-text a:hover { text-shadow: 0 0 10px rgba(201, 169, 97, 0.5); }

.legal-text {
    margin-top: 2rem;
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-align: center;
}
.legal-text i { color: var(--gold); opacity: 0.7; }

/* =================================================================
   STATES — Loading & Success on submit
   ================================================================= */
.btn-auth.is-loading .btn-text::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    border: 1.5px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-auth.is-success {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
}

/* Shake error */
.field.has-error .field-input { border-bottom-color: #e25c5c; }
.field.has-error .field-label { color: #e25c5c; }
.shake { animation: shake 0.5s var(--ease-out); }
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-8px); }
    75%      { transform: translateX(8px); }
}

/* =================================================================
   RESPONSIVE
   ================================================================= */
@media (max-width: 991.98px) {
    .top-nav { padding: 1.25rem 1.5rem; }
    .auth-container { padding-top: 5.5rem; }
    .main-row { min-height: auto; }
    .auth-side { padding: 1rem 1.5rem 2rem; min-height: calc(100vh - 6rem); }
}

@media (max-width: 576px) {
    .top-nav { padding: 1rem 1rem; }
    .brand-divider, .brand-text { display: none; }
    .brand-logo { font-size: 1.6rem; }
    .auth-card { padding: 2.25rem 1.5rem; }
    .auth-title { font-size: 1.9rem; }
    .nav-link-back span { display: none; }
    .nav-link-back { padding: 0.5rem 0.75rem; }
}

/* =================================================================
   PREFERS REDUCED MOTION
   ================================================================= */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    #networkCanvas { display: none; }
    .glow { display: none; }
}


select.field-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23c9a961'><path d='M4 6l4 4 4-4z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.25rem center;
    background-size: 14px;
    padding-right: 2rem;
}

select.field-input option {
    background: var(--bg-darkest);
    color: var(--text-primary);
    padding: 0.5rem;
}

/* Flotar label cuando el select tiene valor o está enfocado */
select.field-input[data-has-value="1"] + .field-label,
select.field-input:focus + .field-label {
    top: -2px;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--gold);
}
