/* ============================================================
   ZAPITA Atendimento — Login Page CSS
   Dark premium theme with glassmorphism
   ============================================================ */

:root {
    --primary: #00C896;
    --primary-dk: #00A87E;
    --accent: #00A0D2;
    --bg: hsl(220, 20%, 97%);
    --bg-card: hsl(0, 0%, 100%);
    --bg-surface: hsl(220, 15%, 93%);
    --border: hsl(220, 15%, 88%);
    --text: hsl(222, 25%, 12%);
    --text-sec: hsl(222, 15%, 40%);
    --text-muted: hsl(222, 10%, 55%);
    --danger: hsl(354, 70%, 54%);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 16px;
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.06);
}

body.dark-theme {
    --bg: hsl(222, 28%, 7%);
    --bg-card: hsl(222, 22%, 11%);
    --bg-surface: hsl(222, 18%, 15%);
    --border: hsl(222, 14%, 18%);
    --text: hsl(0, 0%, 95%);
    --text-sec: hsl(222, 12%, 68%);
    --text-muted: hsl(222, 10%, 46%);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.5);
}

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

html,
body {
    height: 100%;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
}

/* ── Layout ───────────────────────────────────────── */
.login-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Brand Panel (left) ───────────────────────────── */
.brand-panel {
    flex: 1.1;
    position: relative;
    background: linear-gradient(145deg, hsl(220, 20%, 93%) 0%, hsl(220, 15%, 88%) 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 56px;
}
body.dark-theme .brand-panel {
    background: linear-gradient(145deg, hsl(222, 30%, 9%) 0%, hsl(222, 25%, 12%) 100%);
}

/* Decorative background shapes */
.brand-bg-shapes {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.12;
}

.shape-1 {
    width: 600px;
    height: 600px;
    background: var(--primary);
    top: -200px;
    left: -200px;
    animation: floatShape 12s ease-in-out infinite;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: var(--accent);
    bottom: -100px;
    right: -100px;
    animation: floatShape 16s ease-in-out infinite reverse;
}

.shape-3 {
    width: 300px;
    height: 300px;
    background: var(--primary);
    bottom: 30%;
    left: 60%;
    opacity: 0.07;
    animation: floatShape 10s ease-in-out infinite 3s;
}

@keyframes floatShape {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(20px, -30px) scale(1.05);
    }
}

/* Grid overlay pattern */
.brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.018) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}
body.dark-theme .brand-panel::before {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
}

.brand-content {
    position: relative;
    z-index: 1;
    max-width: 500px;
    width: 100%;
}

/* Logo */
.brand-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 52px;
}

.logo-icon {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 16px rgba(0, 200, 150, 0.35));
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.logo-name {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-subtitle {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-sec);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 3px;
}

/* Tagline */
.brand-tagline {
    margin-bottom: 40px;
}

.brand-tagline h1 {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.5px;
    color: var(--text);
    margin-bottom: 14px;
}

.brand-tagline p {
    font-size: 1rem;
    color: var(--text-sec);
    line-height: 1.65;
}

/* Feature list */
.feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 44px;
}

.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.feature-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 10px;
    background: rgba(0, 200, 150, 0.1);
    border: 1px solid rgba(0, 200, 150, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin-top: 1px;
}

.feature-icon svg {
    width: 18px;
    height: 18px;
}

.feature-list li div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.feature-list strong {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.feature-list span {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Stats strip */
.stats-strip {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 20px 24px;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border);
    border-radius: 14px;
}
body.dark-theme .stats-strip {
    background: rgba(255, 255, 255, 0.03);
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-align: center;
    flex: 1;
}

.stat strong {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.3px;
}

.stat span {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-divider {
    width: 1px;
    height: 32px;
    background: var(--border);
    flex-shrink: 0;
}

/* ── Form Panel (right) ───────────────────────────── */
.form-panel {
    width: 460px;
    flex-shrink: 0;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
}

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

/* Mobile logo (hidden on desktop) */
.mobile-logo {
    display: none;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    justify-content: center;
}

.logo-icon-sm {
    width: 40px;
    height: 40px;
}

.mobile-logo span {
    font-size: 1.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.form-header {
    margin-bottom: 28px;
}

.form-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
    margin-bottom: 6px;
}

.form-header p {
    font-size: 0.88rem;
    color: var(--text-sec);
    line-height: 1.5;
}

/* Alert */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 20px;
    animation: slideDown 0.25s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-8px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.alert-error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.field-group label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-sec);
}

.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
    flex-shrink: 0;
}

.input-icon-wrapper input {
    width: 100%;
    height: 48px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0 44px 0 44px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.92rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-icon-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.12);
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: var(--text);
}

.toggle-password svg {
    width: 18px;
    height: 18px;
}

/* Login button */
.btn-login {
    position: relative;
    width: 100%;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
    border-radius: 12px;
    color: #fff;
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
    transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 20px rgba(0, 200, 150, 0.25);
}

.btn-login:hover:not(:disabled) {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 8px 28px rgba(0, 200, 150, 0.35);
}

.btn-login:active:not(:disabled) {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-arrow {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}

.btn-login:hover .btn-arrow {
    transform: translateX(3px);
}

/* Spinner */
.btn-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    position: absolute;
}

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

.hidden {
    display: none !important;
}

/* Footer */
.form-footer {
    margin-top: 32px;
    text-align: center;
}

.form-footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 900px) {
    .login-layout {
        flex-direction: column;
        min-height: 100vh;
    }

    .brand-panel {
        flex: none;
        padding: 36px 24px;
    }

    .brand-tagline h1 {
        font-size: 1.7rem;
    }

    .brand-logo {
        margin-bottom: 28px;
    }

    .feature-list {
        gap: 12px;
        margin-bottom: 28px;
    }

    .form-panel {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border);
        padding: 36px 24px 48px;
    }

    .mobile-logo {
        display: flex;
    }
}

@media (max-width: 480px) {
    .brand-panel {
        display: none;
    }

    .form-panel {
        min-height: 100vh;
        align-items: flex-start;
        padding-top: 60px;
    }

    .mobile-logo {
        display: flex;
    }
}