/**
 * Login Page Styles - Portal Comerciales
 * Split-layout professional design (adapted from Portal de Cliente)
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Reset for login page ──────────────────────────────── */
.login-page {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: #fff;
    display: flex;
    flex-direction: row;
}

/* ── Container ────────────────────────────────────────── */
.login-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ── Left Panel (Form) ────────────────────────────────── */
.login-form-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 4rem;
    max-width: 540px;
    min-width: 380px;
    background: #ffffff;
    position: relative;
    z-index: 2;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.login-brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: contain;
}

.login-brand-text h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
    line-height: 1.2;
}

.login-brand-text span {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 400;
}

/* ── Headings ─────────────────────────────────────────── */
.login-heading {
    margin-bottom: 0.4rem;
    font-size: 1.65rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.login-subheading {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 2rem;
    font-weight: 400;
}

/* ── Form Fields ──────────────────────────────────────── */
.login-field-group {
    margin-bottom: 1.25rem;
}

.login-field-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.45rem;
    letter-spacing: 0.01em;
}

.login-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-wrapper .input-icon {
    position: absolute;
    left: 14px;
    color: #94a3b8;
    font-size: 0.9rem;
    pointer-events: none;
    transition: color 0.25s ease;
    z-index: 2;
}

.login-input-wrapper input,
.login-input-wrapper select {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 2.6rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    color: #1e293b;
    background: #f8fafc;
    transition: all 0.25s ease;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.login-input-wrapper select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8.825a.5.5 0 0 1-.354-.146l-4-4a.5.5 0 0 1 .708-.708L6 7.617l3.646-3.646a.5.5 0 0 1 .708.708l-4 4A.5.5 0 0 1 6 8.825z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px;
    padding-right: 2.5rem;
}

.login-input-wrapper input:focus,
.login-input-wrapper select:focus {
    border-color: #1e293b;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(30, 41, 59, 0.08);
}

.login-input-wrapper input:focus ~ .input-icon,
.login-input-wrapper select:focus ~ .input-icon {
    color: #1e293b;
}

.login-input-wrapper input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.login-input-wrapper select option {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #1e293b;
    background: #fff;
}

.login-input-wrapper select option[value=""] {
    color: #94a3b8;
}

/* Password toggle */
.login-input-wrapper .password-toggle-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    font-size: 0.9rem;
    transition: color 0.2s ease;
    z-index: 2;
}

.login-input-wrapper .password-toggle-btn:hover {
    color: #475569;
}

/* ── Submit Button ────────────────────────────────────── */
.login-submit-btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: #0f172a;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}

.login-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.login-submit-btn:hover {
    background: #1e293b;
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.25);
}

.login-submit-btn:hover::before {
    left: 100%;
}

.login-submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

/* ── Links ────────────────────────────────────────────── */
.login-link {
    display: block;
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.85rem;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.login-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* ── Alerts ───────────────────────────────────────────── */
.login-alert {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.login-alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.login-alert-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.login-alert i {
    font-size: 1rem;
}

/* ── Right Panel (Hero) ───────────────────────────────── */
.login-hero-panel {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 100vh;
}

.login-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/img/background-login.png');
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.login-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(15, 23, 42, 0.88) 0%,
        rgba(30, 58, 95, 0.82) 50%,
        rgba(15, 23, 42, 0.90) 100%
    );
    z-index: 1;
}

.login-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 3rem;
    max-width: 480px;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.login-hero-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.75rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.login-hero-icon i {
    font-size: 2rem;
    color: #fff;
}

.login-hero-content h2 {
    font-size: 1.65rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.login-hero-content p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.7;
    margin-bottom: 2rem;
    font-weight: 300;
}

/* ── Hero Badges ──────────────────────────────────────── */
.login-hero-badges {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 0.5rem;
}

.login-hero-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    font-weight: 500;
}

.login-hero-badge i {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
}

/* ── Animations ───────────────────────────────────────── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-form-panel {
    animation: fadeIn 0.6s ease-out both;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 992px) {
    .login-container {
        flex-direction: column;
    }

    .login-hero-panel {
        display: none;
    }

    .login-form-panel {
        max-width: 100%;
        min-width: unset;
        padding: 2rem 1.5rem;
        min-height: 100vh;
        align-items: center;
    }

    .login-form-panel > * {
        max-width: 420px;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .login-form-panel {
        padding: 1.5rem 1.25rem;
    }

    .login-heading {
        font-size: 1.4rem;
    }
}
