﻿/* SectorWeb mobile-first stylesheet */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font: 16px/1.4 -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; background: #f7f8fa; color: #1a1a1a; }
h1, h2, h3 { margin: 0 0 8px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
a { color: #1565C0; }

/* Top bar */

/* Bottom navigation */
.bottombar {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: #fff; border-top: 2px solid #1565C0;
    display: flex; z-index: 10;
}
.bottombar a {
    flex: 1; text-align: center; text-decoration: none;
    color: #666; font-size: 15px; font-weight: 600;
    padding: 12px 0;
}
.bottombar a.active { color: #1565C0; background: #e3f2fd; }
.bottombar a:active { color: #1565C0; }

/* Main content */
.main { padding: 16px; padding-bottom: 60px; max-width: 600px; margin: 0 auto; }

/* Card */
.card {
    background: #fff; border-radius: 8px;
    padding: 16px; margin-bottom: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,.06);
}

/* Voter card */
.voter-card {
    background: #fff; border-radius: 8px;
    padding: 12px; margin-bottom: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.voter-card a { float: right; color: #1565C0; text-decoration: none; }
.voter-card a:active { text-decoration: underline; }

/* Buttons */
.btn {
    display: inline-block; padding: 10px 20px;
    background: #1565C0; color: white;
    border-radius: 6px; text-decoration: none;
    border: none; font-size: 16px; cursor: pointer;
}
.btn:active { background: #1B5E20; }

/* Form */
input[type=text], input[type=password], input[type=email], textarea, select {
    width: 100%; padding: 10px;
    border: 1px solid #ccc; border-radius: 6px;
    font-size: 16px; box-sizing: border-box;
    font-family: inherit;
}
textarea { min-height: 60px; resize: vertical; }
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 14px; }

/* Status */
.err { color: #C62828; font-weight: 600; }
.ok  { color: #1565C0; font-weight: 600; }

/* Telerik tweak */
.RadInput, .RadComboBox, .RadPicker { width: 100% !important; }

/* Voters tile menu */
.tile-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; padding: 16px; }
.tile { background: white; border-radius: 12px; padding: 16px; text-align: center; text-decoration: none; color: #1a1a1a; box-shadow: 0 1px 3px rgba(0,0,0,.08); transition: transform .1s; }
.tile:active { transform: scale(0.97); }
.tile img { width: 80px; height: 80px; object-fit: contain; }
.tile h5 { margin: 8px 0 0; font-size: 14px; font-weight: 600; }
.back-link { display: inline-block; padding: 8px 12px; color: #2E7D32; text-decoration: none; font-size: 14px; }
.filter-bar { display: flex; gap: 8px; padding: 8px 16px; flex-wrap: wrap; }
.filter-bar input, .filter-bar select { padding: 8px; border: 1px solid #ccc; border-radius: 6px; }
.filter-bar .btn { padding: 8px 16px; background: #2E7D32; color: white; border: none; border-radius: 6px; cursor: pointer; }
.letter-picker { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 16px; }
.letter-picker a { padding: 4px 8px; background: #f0f0f0; color: #1a1a1a; text-decoration: none; border-radius: 4px; font-size: 12px; }
.letter-picker a.active { background: #2E7D32; color: white; }


.topbar .logout-btn:hover { background:rgba(239,68,68,.85); border-color:rgba(239,68,68,.95); }

/* ===== Topbar (unified) ===== */
.topbar { display:flex; justify-content:space-between; align-items:center; padding:14px 18px; color:#fff; background:linear-gradient(135deg,#0d1117 0%,#161b22 100%); border-bottom:1px solid rgba(255,255,255,.06); box-shadow:0 2px 12px rgba(0,0,0,.35); position:sticky; top:0; z-index:50; }
.topbar .brand { font-family:'JetBrains Mono', monospace, sans-serif; font-weight:800; font-size:18px; letter-spacing:.06em; text-transform:uppercase; color:#22e3c3; text-shadow:0 0 16px rgba(34,227,195,.35); }
.topbar.layer-state         .brand { color:#fde047; text-shadow:0 0 16px rgba(253,224,71,.35); }
.topbar.layer-district      .brand { color:#a855f7; text-shadow:0 0 16px rgba(168,85,247,.35); }
.topbar.layer-parliamentary .brand { color:#3b82f6; text-shadow:0 0 16px rgba(59,130,246,.35); }
.topbar.layer-assembly      .brand { color:#ef4444; text-shadow:0 0 16px rgba(239,68,68,.35); }
.topbar.layer-sector        .brand { color:#10b981; text-shadow:0 0 16px rgba(16,185,129,.35); }
.topbar.layer-booth         .brand { color:#f59e0b; text-shadow:0 0 16px rgba(245,158,11,.35); }
.topbar a, .topbar span { color:#fff; }
.topbar a { text-decoration:none; }
.topbar .logout-btn { display:inline-block; padding:7px 16px; background:rgba(255,255,255,.06); color:#fff; border:1px solid rgba(255,255,255,.18); border-radius:8px; font-size:13px; font-weight:600; text-decoration:none; transition:all .15s; cursor:pointer; }
.topbar .logout-btn:hover { background:rgba(239,68,68,.85); border-color:rgba(239,68,68,.95); transform:translateY(-1px); }
@media (max-width: 480px) {
    .topbar { padding:10px 12px; }
    .topbar .brand { font-size:15px; letter-spacing:.04em; }
    .topbar .logout-btn { padding:5px 12px; font-size:12px; }
}

/* ===== Login page ===== */
.login-body { background: linear-gradient(135deg, #0d1117 0%, #1a1f2e 50%, #0d1117 100%) fixed; min-height: 100vh; color: #fff; }
.login-body .main { padding: 24px 18px; max-width: 460px; margin: 0 auto; padding-top: 5vh; }
.login-body img { box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.06); }
.login-body .card { background: rgba(22,27,34,.85); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.08); border-radius: 16px; padding: 28px 24px; box-shadow: 0 20px 50px rgba(0,0,0,.4); color: #fff; }
.login-body .card h2 { font-family: 'JetBrains Mono', monospace, sans-serif; font-size: 32px; font-weight: 800; margin: 0 0 6px; letter-spacing: .04em; text-transform: uppercase; background: linear-gradient(90deg, #22e3c3, #a855f7); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.login-body .card .subtitle { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: #94a3b8; margin-bottom: 24px; font-weight: 600; }
.login-body .form-row { margin-bottom: 16px; }
.login-body .form-row label { display:block; font-weight: 600; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #94a3b8; margin-bottom: 6px; }
.login-body .form-row input[type="text"], .login-body .form-row input[type="password"] { width: 100%; box-sizing: border-box; padding: 12px 14px; background: rgba(13,17,23,.6); border: 1px solid rgba(255,255,255,.12); border-radius: 10px; color: #fff; font-size: 15px; font-family: inherit; transition: all .15s; }
.login-body .form-row input[type="text"]:focus, .login-body .form-row input[type="password"]:focus { outline: none; border-color: #22e3c3; box-shadow: 0 0 0 3px rgba(34,227,195,.15); background: rgba(13,17,23,.85); }
.login-body .btn { display: inline-block; width: 100%; padding: 13px 20px; background: linear-gradient(135deg, #22e3c3, #06b6d4); color: #0d1117; border: none; border-radius: 10px; font-weight: 800; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; text-decoration: none; text-align: center; cursor: pointer; transition: all .15s; box-shadow: 0 6px 20px rgba(34,227,195,.25); }
.login-body .btn:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(34,227,195,.4); }
.login-body .err { display: block; margin-top: 14px; padding: 10px 14px; background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.3); border-radius: 8px; color: #fca5a5; font-size: 13px; }
@media (max-width: 480px) { .login-body .card h2 { font-size: 26px; } .login-body .main { padding-top: 2vh; } }

/* Parliamentary layer theme */
body.layer-parliamentary { --layer-primary: #3b82f6; --layer-secondary: #06b6d4; }
.login-body.layer-parliamentary { background: linear-gradient(135deg, #0a1224 0%, #0d1730 50%, #0d1117 100%) fixed; }
.login-body.layer-parliamentary .card h2 { background: linear-gradient(90deg, #3b82f6, #06b6d4); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.login-body.layer-parliamentary .form-row input[type="text"]:focus, .login-body.layer-parliamentary .form-row input[type="password"]:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.18); }
.login-body.layer-parliamentary .btn { background: linear-gradient(135deg, #3b82f6, #06b6d4); color: #0d1117; box-shadow: 0 6px 20px rgba(59,130,246,.28); }
.login-body.layer-parliamentary .btn:hover { box-shadow: 0 10px 28px rgba(59,130,246,.45); }