/* ========================================================
   /central/_shared/styles.css
   CSS compartilhado: cores, dark/light, login moderno,
   componentes reusáveis pela Central e Portaria.
   ======================================================== */

:root {
    /* Cores do projeto */
    --primary: #FF822D;
    --primary-hover: #e6701f;
    --primary-light: #FFE5D1;

    /* Light mode (default) */
    --bg: #ECF3FA;
    --bg-soft: #FFFFFF;
    --bg-card: #FFFFFF;
    --text: #000000;
    --text-soft: #555;
    --text-muted: #888;
    --border: #d8e1ea;
    --border-soft: #eef2f6;
    --shadow: 0 4px 20px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
    --status-online: #16a34a;
    --status-rec: #dc2626;
    --status-offline: #94a3b8;
    --danger: #dc2626;
    --warn: #d97706;
}

[data-theme="dark"] {
    --bg: #000000;
    --bg-soft: #0d0d0d;
    --bg-card: #1a1a1a;
    --text: #FFFFFF;
    --text-soft: #cfcfcf;
    --text-muted: #888;
    --border: #2a2a2a;
    --border-soft: #1f1f1f;
    --shadow: 0 4px 20px rgba(0,0,0,0.6);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.8);
    --primary-light: #4a2410;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    transition: background 0.25s ease, color 0.25s ease;
}

/* ========================================================
   FLOATING BUTTONS (theme + lang)
   ======================================================== */
.float-controls {
    position: fixed;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 8px;
    z-index: 1000;
}

.float-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
    box-shadow: var(--shadow);
}

.float-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-1px);
}

.float-btn .lang-flag {
    font-size: 18px;
    line-height: 1;
}

/* Lang dropdown */
.lang-wrap { position: relative; }
.lang-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    min-width: 130px;
    display: none;
    z-index: 1001;
}
.lang-menu.open { display: block; }
.lang-menu button {
    display: flex;
    align-items: center;
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text);
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    gap: 8px;
    text-align: left;
}
.lang-menu button:hover { background: var(--primary); color: #fff; }
.lang-menu button .lang-flag { font-size: 16px; }

/* ========================================================
   LOGIN SCREEN
   ======================================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Decoração de fundo: círculos coloridos suaves */
.login-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255,130,45,0.15) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    pointer-events: none;
}
.login-page::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,130,45,0.08) 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
    pointer-events: none;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 2;
    animation: slideIn 0.4s ease-out;
}

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

.login-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary) 0%, #ff9d5e 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 8px 24px rgba(255, 130, 45, 0.4);
}

.login-icon svg {
    width: 32px;
    height: 32px;
    fill: #fff;
}

.login-title {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin: 0 0 6px;
    color: var(--text);
}

.login-subtitle {
    font-size: 13px;
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 28px;
}

.input-group { margin-bottom: 16px; }

.input-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-soft);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.input-wrap {
    position: relative;
}

.input-wrap input {
    width: 100%;
    height: 46px;
    background: var(--bg-soft);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 0 14px;
    font-size: 14px;
    color: var(--text);
    transition: all 0.2s;
    font-family: inherit;
}

.input-wrap input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 130, 45, 0.15);
}

.input-wrap input.with-icon {
    padding-right: 44px;
}

.input-icon-btn {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 14px;
}
.input-icon-btn:hover { background: var(--border-soft); color: var(--text); }

.btn-primary {
    width: 100%;
    height: 48px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(255, 130, 45, 0.35);
}

.btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.btn-google {
    width: 100%;
    height: 46px;
    background: var(--bg-soft);
    color: var(--text);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.btn-google:hover { border-color: var(--primary); }
.btn-google img { width: 18px; height: 18px; }

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
    color: var(--text-muted);
    font-size: 11px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.login-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.login-link:hover { text-decoration: underline; }

.text-center { text-align: center; }
.mt-3 { margin-top: 16px; }

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert-error {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger);
    border: 1px solid rgba(220, 38, 38, 0.2);
}
.alert-success {
    background: rgba(22, 163, 74, 0.1);
    color: var(--status-online);
    border: 1px solid rgba(22, 163, 74, 0.2);
}

.app-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
}
.app-link:hover { color: var(--primary); }

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========================================================
   ERRO PROVEDOR
   ======================================================== */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.error-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    box-shadow: var(--shadow);
    max-width: 420px;
    border: 1px solid var(--border);
}
.error-icon { font-size: 56px; margin-bottom: 16px; }
.error-title { font-size: 20px; font-weight: 700; margin: 0 0 8px; }
.error-text { color: var(--text-muted); font-size: 14px; }

/* ========================================================
   MOBILE
   ======================================================== */
@media (max-width: 480px) {
    .login-card {
        padding: 30px 24px;
        border-radius: 16px;
    }
    .login-title { font-size: 19px; }
    .float-controls { top: 12px; right: 12px; }
    .float-btn { width: 36px; height: 36px; }
}