/* ============================================================
   J&A FERNANDEZ MOTORS – LOGIN PAGE
   Corporate Redesign v6.0
   Colores Corporativos Base:
     - Primario:   #175ED7 (Azul Corporativo / Royal Tech Blue)
     - Secundario: #B0B9C8 (Slate Silver / Cool Steel)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* ---------- RESET & BASE ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary:          #175ED7;
    --primary-hover:    #124bb0;
    --primary-dark:     #0c3682;
    --primary-light:    #3d7ef0;
    --primary-soft:     rgba(23, 94, 215, 0.12);
    --primary-glow:     rgba(23, 94, 215, 0.35);

    --secondary:        #B0B9C8;
    --secondary-light:  #e2e8f0;
    --secondary-dark:   #687a93;
    --secondary-border: rgba(176, 185, 200, 0.28);
    --secondary-soft:   rgba(176, 185, 200, 0.12);

    --bg-dark:          #080e18;
    --bg-navy:          #0e1726;
    --bg-surface:       #131f33;
    --card-bg:          rgba(14, 23, 38, 0.88);

    --border:           rgba(176, 185, 200, 0.18);
    --border-focus:     rgba(23, 94, 215, 0.7);

    --text:             #f8fafc;
    --text-muted:       #B0B9C8;
    --text-sub:         #8c9cb3;
    --input-bg:         rgba(255, 255, 255, 0.04);
    --font:             'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font);
    font-size: 15px;
    color: var(--text);
    background: var(--bg-dark);
    overflow: hidden;
}

/* ============================================================
   BACKGROUND SCENE
   ============================================================ */
#section-login {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 100vh;
    overflow: hidden;
}

/* Fondo degradado ambiental profundo */
.bg-gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 50%, rgba(23, 94, 215, 0.16) 0%, transparent 60%),
        radial-gradient(ellipse 65% 75% at 85% 25%, rgba(176, 185, 200, 0.12) 0%, transparent 65%),
        radial-gradient(ellipse 50% 50% at 50% 90%, rgba(15, 26, 46, 0.8) 0%, transparent 70%),
        linear-gradient(135deg, #070c14 0%, #0d1624 45%, #121c2e 100%);
    z-index: 0;
}

/* Cuadrícula isométrica tech corporativa */
.bg-grid {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0.16;
    background-image:
        linear-gradient(rgba(23, 94, 215, 0.35) 1px, transparent 1px),
        linear-gradient(90deg, rgba(176, 185, 200, 0.35) 1px, transparent 1px);
    background-size: 55px 55px;
    transform: perspective(650px) rotateX(55deg) translateY(-20%);
    transform-origin: center bottom;
}

/* Orbes flotantes de luz ambiental */
.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(85px);
    z-index: 1;
    opacity: 0.4;
    animation: orbFloat 9s ease-in-out infinite alternate;
}

.bg-orb.orb1 {
    width: 440px;
    height: 440px;
    background: radial-gradient(circle, rgba(23, 94, 215, 0.65), transparent 70%);
    top: -90px;
    left: -100px;
    animation-duration: 10s;
}

.bg-orb.orb2 {
    width: 340px;
    height: 340px;
    background: radial-gradient(circle, rgba(176, 185, 200, 0.5), transparent 70%);
    bottom: -60px;
    right: 36%;
    animation-duration: 13s;
    animation-delay: -5s;
}

@keyframes orbFloat {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(32px, 24px) scale(1.08); }
}

/* ============================================================
   BRAND PANEL (lado izquierdo – desktop)
   ============================================================ */
.brand-panel {
    display: none;
    position: relative;
    z-index: 5;
    flex: 1;
    padding: 60px 60px 60px 80px;
    flex-direction: column;
    gap: 32px;
}

.brand-logo-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.brand-tagline {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    font-size: 0.78em;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--primary-light);
    background: var(--primary-soft);
    border: 1px solid var(--secondary-border);
    padding: 5px 14px;
    border-radius: 20px;
    font-weight: 600;
}

.brand-name {
    font-size: 3.6em;
    font-weight: 800;
    line-height: 1.05;
    color: #ffffff;
    letter-spacing: -1px;
}

.brand-name span {
    color: var(--primary-light);
    background: linear-gradient(135deg, #175ED7 0%, #609bf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-desc {
    font-size: 1.02em;
    color: var(--text-muted);
    font-weight: 300;
    line-height: 1.7;
    max-width: 400px;
}

/* SVG ilustración flotante */
.brand-svg-wrap {
    margin-top: 10px;
    opacity: 0.9;
    filter: drop-shadow(0 20px 50px rgba(23, 94, 215, 0.3));
    animation: bikeFloat 4.5s ease-in-out infinite alternate;
}

@keyframes bikeFloat {
    from { transform: translateY(0px); }
    to   { transform: translateY(-10px); }
}

/* Features / bullets corporativos */
.brand-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--secondary-light);
    font-size: 0.92em;
    font-weight: 400;
    background: rgba(255, 255, 255, 0.02);
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid rgba(176, 185, 200, 0.1);
    max-width: 420px;
    transition: transform 0.25s, border-color 0.25s, background 0.25s;
}

.feature-item:hover {
    transform: translateX(6px);
    background: rgba(23, 94, 215, 0.07);
    border-color: rgba(23, 94, 215, 0.35);
}

.feature-icon {
    width: 38px;
    height: 38px;
    background: var(--primary-soft);
    border: 1px solid rgba(23, 94, 215, 0.3);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-icon svg {
    width: 20px;
    height: 20px;
    fill: var(--primary-light);
}

/* ============================================================
   LOGIN CARD
   ============================================================ */
.wrap-login {
    position: relative;
    z-index: 10;
    background: var(--card-bg);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 46px 44px 36px;
    width: 440px;
    max-width: calc(100% - 36px);
    margin-right: 80px;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.7s ease, transform 0.6s ease;
    box-shadow:
        0 30px 70px rgba(0, 0, 0, 0.65),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 0 50px rgba(23, 94, 215, 0.12);
}

.wrap-login.visible {
    opacity: 1;
    transform: translateY(0);
    animation: cardReveal 0.7s cubic-bezier(.22,.68,0,1.2) forwards;
}

@keyframes cardReveal {
    from { opacity: 0; transform: translateY(22px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

/* Línea de acento superior corporativa (#175ED7 y #B0B9C8) */
.wrap-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), var(--secondary), transparent);
    border-radius: 0 0 4px 4px;
}

/* ============================================================
   HEADER DEL CARD
   ============================================================ */
.card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-bottom: 26px;
}

/* Logo con aura rotatoria */
#logo {
    position: relative;
    width: 88px;
    height: 88px;
}

#logo::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: conic-gradient(var(--primary) 0deg, var(--secondary) 180deg, var(--primary) 360deg);
    animation: spinRing 7s linear infinite;
    opacity: 0.55;
    z-index: -1;
}

@keyframes spinRing {
    to { transform: rotate(360deg); }
}

#logo img {
    width: 88px;
    height: 88px;
    object-fit: contain;
    border-radius: 50%;
    border: 2px solid rgba(23, 94, 215, 0.45);
    background: rgba(255, 255, 255, 0.05);
    box-shadow:
        0 0 0 6px rgba(23, 94, 215, 0.1),
        0 12px 32px rgba(0, 0, 0, 0.5);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

#logo img:hover {
    transform: scale(1.06);
    box-shadow: 0 0 0 8px rgba(23, 94, 215, 0.2), 0 16px 40px rgba(0, 0, 0, 0.6);
}

.card-title-group {
    text-align: center;
}

.card-company {
    font-size: 0.88em;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--secondary);
    margin-bottom: 4px;
}

.title {
    font-size: 1.55em;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.3px;
}

.card-subtitle {
    font-size: 0.82em;
    color: var(--text-sub);
    font-weight: 400;
    margin-top: 3px;
}

/* ============================================================
   SVG SEPARADOR
   ============================================================ */
.divider-svg {
    width: 100%;
    margin-bottom: 24px;
    opacity: 0.6;
}

/* ============================================================
   FORM
   ============================================================ */
.wrap-form {
    width: 100%;
}

.form-group {
    position: relative;
    margin-bottom: 18px;
}

/* Label */
.input-label {
    display: block;
    font-size: 0.75em;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--secondary);
    margin-bottom: 7px;
    transition: color 0.3s;
}

.form-group:focus-within .input-label {
    color: var(--primary-light);
}

/* Input */
.form-control {
    display: block;
    width: 100%;
    height: 50px;
    padding: 10px 50px 10px 18px;
    font-family: var(--font);
    font-size: 0.95em;
    color: #ffffff;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    outline: none;
    transition: all 0.3s ease;
    -webkit-appearance: none;
}

.form-control::placeholder {
    color: rgba(176, 185, 200, 0.35);
    font-weight: 300;
}

.form-control:focus {
    background: rgba(23, 94, 215, 0.08);
    border-color: var(--border-focus);
    box-shadow:
        0 0 0 3px rgba(23, 94, 215, 0.22),
        0 4px 20px rgba(0, 0, 0, 0.25);
}

/* Íconos en inputs */
.input-icon {
    position: absolute;
    right: 16px;
    bottom: 15px;
    width: 20px;
    height: 20px;
    fill: var(--secondary) !important;
    opacity: 0.55;
    transition: opacity 0.3s, fill 0.3s;
    pointer-events: none;
}

.form-group:focus-within .input-icon {
    opacity: 1;
    fill: var(--primary-light) !important;
}

/* ============================================================
   BOTÓN SUBMIT
   ============================================================ */
.btn-submit-group {
    margin-top: 26px;
}

.btn-rr {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px 28px;
    font-family: var(--font);
    font-size: 0.98em;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    border: 1px solid var(--secondary-border);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
        0 8px 24px var(--primary-glow),
        0 2px 6px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-rr::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.55s ease;
}

.btn-rr:hover::before {
    left: 100%;
}

.btn-rr:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    box-shadow:
        0 14px 32px rgba(23, 94, 215, 0.48),
        0 4px 10px rgba(0, 0, 0, 0.4);
}

.btn-rr:active {
    transform: translateY(0);
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-rr svg {
    width: 18px;
    height: 18px;
    fill: #ffffff;
    transition: transform 0.3s ease;
}

.btn-rr:hover svg {
    transform: translateX(4px);
}

/* ============================================================
   FOOTER
   ============================================================ */
.wrap-foot {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(176, 185, 200, 0.14);
    text-align: center;
}

.wrap-foot .footer-version {
    font-size: 0.74em;
    color: var(--text-sub);
    letter-spacing: 0.5px;
}

.wrap-foot .footer-brand {
    font-size: 0.8em;
    color: var(--secondary);
    margin-top: 4px;
}

.wrap-foot .footer-brand a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.25s;
}

.wrap-foot .footer-brand a:hover {
    color: #ffffff;
}

.wrap-foot .footer-dev {
    font-size: 0.72em;
    color: var(--text-sub);
    margin-top: 6px;
}

.wrap-foot .footer-dev a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.25s;
}

.wrap-foot .footer-dev a:hover {
    color: var(--primary-light);
}

/* ============================================================
   RESPONSIVE – MÓVIL
   ============================================================ */
@media screen and (max-width: 767px) {
    body {
        overflow: auto;
    }

    .bg-grid {
        display: none;
    }

    #section-login {
        justify-content: center;
        align-items: flex-start;
        padding: 24px 16px 40px;
        min-height: 100vh;
    }

    .wrap-login {
        width: 100%;
        margin-right: 0;
        padding: 36px 24px 26px;
        border-radius: 20px;
        margin-top: 16px;
    }

    #logo {
        width: 76px;
        height: 76px;
    }

    #logo img {
        width: 76px;
        height: 76px;
    }

    .title {
        font-size: 1.35em;
    }

    .form-control {
        height: 48px;
        font-size: 0.92em;
    }

    .btn-rr {
        padding: 14px 20px;
    }
}

/* ============================================================
   RESPONSIVE – TABLET / DESKTOP
   ============================================================ */
@media screen and (min-width: 768px) {
    #section-login {
        justify-content: flex-end;
    }
    .brand-panel {
        display: flex;
    }
    .wrap-login {
        margin-right: 60px;
    }
}

@media screen and (min-width: 1200px) {
    .wrap-login {
        margin-right: 100px;
    }
}

@media screen and (min-width: 1400px) {
    .wrap-login {
        margin-right: 140px;
    }
}
