/* css/login.css - REDISEÑO SPLIT LAYOUT AZUL-NEGRO HIMAGEN */

/* ===========================
   GOOGLE FONT PARA LOGIN
   (DM Sans se carga en index.html)
   =========================== */

/* ===========================
   OVERRIDE BODY CUANDO LOGIN VISIBLE
   =========================== */
body:has(#login-container:not(.hidden)) {
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

body:has(#login-container:not(.hidden)) .main-wrapper {
    min-height: 100vh;
    padding: 0;
    justify-content: stretch;
}

body:has(#login-container:not(.hidden)) .client-footer {
    display: none;
}

/* ===========================
   CONTENEDOR PRINCIPAL LOGIN
   =========================== */
#login-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
    background: #1E2530;
    font-family: 'DM Sans', 'Quicksand', sans-serif;
    overflow-y: auto;
}

/* ===========================
   LADO IZQUIERDO: BRANDING
   =========================== */
.login-brand-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 50px 40px;
    min-height: 100vh;
}

.brand-content {
    max-width: 460px;
    width: 100%;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 40px;
}

.brand-logo-icon {
    width: 32px;
    height: 32px;
    background: var(--color-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
}

.brand-logo-name {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255,255,255,0.35);
    letter-spacing: 0.5px;
}

.brand-content h1 {
    font-size: 34px;
    font-weight: 700;
    color: #f0f2f5;
    line-height: 1.2;
    margin-bottom: 14px;
    letter-spacing: -0.5px;
}

.brand-content h1 span {
    color: var(--color-primary);
}

.brand-tagline {
    font-size: 15px;
    color: rgba(255,255,255,0.35);
    line-height: 1.7;
    margin-bottom: 36px;
    max-width: 360px;
    font-weight: 400;
}

/* ===========================
   GRILL ANIMADO
   =========================== */
.grill-demo {
    background: #252d3a;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 20px;
}

.grill-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.grill-dots { display: flex; gap: 6px; }
.grill-dots span { width: 8px; height: 8px; border-radius: 50%; }
.grill-dots span:nth-child(1) { background: #ff5f57; }
.grill-dots span:nth-child(2) { background: #ffbd2e; }
.grill-dots span:nth-child(3) { background: #28c840; }

.grill-title {
    font-size: 11px;
    color: rgba(255,255,255,0.35);
    font-weight: 500;
    letter-spacing: 0.5px;
}

.grill-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.grill-cell {
    aspect-ratio: 4/5;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
}

.grill-cell .cell-fill {
    position: absolute;
    inset: 0;
    border-radius: 7px;
    opacity: 0;
    transform: scale(0.9);
    animation: cellAppear 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.grill-cell:nth-child(1) .cell-fill { background: linear-gradient(145deg, #e84393, #fd79a8); animation-delay: 0.8s; }
.grill-cell:nth-child(2) .cell-fill { background: linear-gradient(145deg, #6c5ce7, #a29bfe); animation-delay: 1.1s; }
.grill-cell:nth-child(3) .cell-fill { background: linear-gradient(145deg, #00b894, #55efc4); animation-delay: 1.4s; }
.grill-cell:nth-child(4) .cell-fill { background: linear-gradient(145deg, #fdcb6e, #ffeaa7); animation-delay: 1.7s; }
.grill-cell:nth-child(5) .cell-fill { background: linear-gradient(145deg, var(--color-primary), #e8668f); animation-delay: 2.0s; }
.grill-cell:nth-child(6) .cell-fill { background: linear-gradient(145deg, #0984e3, #74b9ff); animation-delay: 2.3s; }
.grill-cell:nth-child(7) .cell-fill { background: linear-gradient(145deg, #e17055, #fab1a0); animation-delay: 2.6s; }
.grill-cell:nth-child(8) .cell-fill { background: linear-gradient(145deg, #00cec9, #81ecec); animation-delay: 2.9s; }
.grill-cell:nth-child(9) .cell-fill { background: linear-gradient(145deg, #636e72, #b2bec3); animation-delay: 3.2s; }

@keyframes cellAppear {
    0% { opacity: 0; transform: scale(0.85); }
    100% { opacity: 1; transform: scale(1); }
}

.grill-cell .cell-icon {
    position: absolute;
    top: 6px; right: 6px;
    font-size: 12px;
    color: rgba(255,255,255,0.8);
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
    opacity: 0;
    animation: iconFade 0.4s ease forwards;
    z-index: 2;
}

.grill-cell:nth-child(2) .cell-icon { animation-delay: 1.5s; }
.grill-cell:nth-child(5) .cell-icon { animation-delay: 2.4s; }
.grill-cell:nth-child(7) .cell-icon { animation-delay: 3.0s; }

@keyframes iconFade { to { opacity: 1; } }

.grill-cell .cell-fill::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    animation: shimmer 2s ease-in-out infinite;
    animation-delay: 4s;
}

@keyframes shimmer { 0% { left: -100%; } 100% { left: 100%; } }

.grill-progress {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.grill-progress-bar {
    flex: 1; height: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: 4px;
    overflow: hidden;
}

.grill-progress-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    border-radius: 4px;
    animation: progressFill 3.5s cubic-bezier(0.4, 0, 0.2, 1) 0.8s forwards;
}

@keyframes progressFill { 0% { width: 0%; } 100% { width: 100%; } }

.grill-progress-text {
    font-size: 11px;
    color: rgba(255,255,255,0.35);
    font-weight: 500;
    min-width: 30px;
    text-align: right;
}

.brand-features {
    display: flex;
    gap: 24px;
    margin-top: 32px;
}

.brand-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255,255,255,0.35);
    font-weight: 400;
}

.brand-feature i { color: var(--color-primary); font-size: 14px; }

/* ===========================
   LADO DERECHO: FORMULARIO
   =========================== */
.login-form-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    position: relative;
    min-height: 100vh;
}

.login-form-side::before {
    content: '';
    position: absolute;
    left: 0;
    top: 25%; bottom: 25%;
    width: 1px;
    background: rgba(255,255,255,0.08);
}

.login-form-container {
    width: 100%;
    max-width: 380px;
}

/* Logo del form */
.login-form-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
}

.login-form-logo .lf-icon {
    width: 36px;
    height: 36px;
    background: var(--color-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
}

.login-form-logo .lf-text {
    font-size: 18px;
    font-weight: 700;
    color: #f0f2f5;
    letter-spacing: -0.2px;
}

.login-form-logo .lf-text span {
    color: var(--color-primary);
}

#login-container h2 {
    font-size: 26px;
    font-weight: 700;
    color: #f0f2f5;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.login-subtitle {
    font-size: 15px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 28px;
    font-weight: 400;
}

/* ===========================
   FORMULARIO
   =========================== */
#login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
}

#login-form input[type="text"],
#login-form input[type="password"],
#login-form input[type="email"] {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    font-family: 'DM Sans', 'Quicksand', sans-serif;
    border: 1.5px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    background: #2c3544;
    color: #f0f2f5;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

#login-form input::placeholder { color: rgba(255,255,255,0.2); }

#login-form input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(201, 55, 111, 0.12);
}

.form-options {
    display: flex;
    justify-content: flex-end;
    margin-top: -6px;
}

.form-options a {
    font-size: 13px;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

.form-options a:hover { text-decoration: underline; }

/* ===========================
   BOTONES
   =========================== */
.login-btn {
    width: 100%;
    padding: 13px 20px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'DM Sans', 'Quicksand', sans-serif;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#login-form button[type="submit"],
.login-btn-primary {
    background: var(--color-primary);
    color: #fff;
    width: 100%;
    padding: 13px 20px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'DM Sans', 'Quicksand', sans-serif;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#login-form button[type="submit"]:hover,
.login-btn-primary:hover {
    background: #b82e62;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(201, 55, 111, 0.3);
}

#login-form button[type="submit"]:active,
.login-btn-primary:active { transform: translateY(0); }

.login-divider {
    display: flex;
    align-items: center;
    gap: 14px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.08);
}

.login-divider span {
    font-size: 12px;
    color: rgba(255,255,255,0.35);
    font-weight: 500;
    white-space: nowrap;
}

.login-btn-google {
    background: #2c3544;
    color: #f0f2f5;
    border: 1.5px solid rgba(255,255,255,0.08);
}

.login-btn-google:hover {
    background: #252d3a;
    border-color: rgba(255,255,255,0.15);
}

.login-btn-google svg { width: 18px; height: 18px; }

.login-form-footer {
    text-align: center;
    margin-top: 28px;
    font-size: 14px;
    color: rgba(255,255,255,0.35);
    font-weight: 400;
}

.login-form-footer a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.login-form-footer a:hover { text-decoration: underline; }

/* ===========================
   ERROR INLINE
   =========================== */
.login-error {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.25);
    color: #fca5a5;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: shakeError 0.35s ease;
}

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-3px); }
}

/* ===========================
   LOADING STATE
   =========================== */
#login-form button[type="submit"].is-loading,
.login-btn-primary.is-loading {
    pointer-events: none;
    opacity: 0.8;
}

#login-form button[type="submit"].is-loading::after,
.login-btn-primary.is-loading::after {
    content: '';
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: loginSpin 0.5s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

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

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 900px) {
    #login-container { flex-direction: column; }
    .login-brand-side { padding: 36px 28px 28px; min-height: auto; }
    .login-form-side { padding: 32px 24px 40px; min-height: auto; }
    .brand-content h1 { font-size: 24px; }
    .brand-tagline { font-size: 13px; margin-bottom: 24px; }
    .grill-grid { gap: 5px; }
    .brand-features { gap: 16px; margin-top: 20px; }
    .login-form-side::before { display: none; }
}

@media (max-width: 480px) {
    .login-brand-side { padding: 28px 20px 20px; }
    .brand-content h1 { font-size: 21px; }
    .brand-tagline { display: none; }
    .brand-features { display: none; }
    .brand-logo { margin-bottom: 20px; }
    .grill-demo { padding: 14px; }
    .grill-grid { gap: 4px; }
}