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

:root {
  --primary: #1a73e8;
  --primary-dark: #1558b0;
  --bg: #f0f4f8;
  --surface: #ffffff;
  --text: #202124;
  --text-secondary: #5f6368;
  --error: #d93025;
  --success: #1e8e3e;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,.12);
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
}

.hidden { display: none !important; }

/* ── LOGIN ── */
#view-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 24px;
}

.login-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 32px;
  width: 100%;
  max-width: 380px;
}

.logo {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  margin-bottom: 32px;
}

/* ── TOPBAR ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 56px;
  box-shadow: var(--shadow);
}

#header-title { font-weight: 600; font-size: 1.1rem; }

/* ── LAYOUT ── */
.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.card h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 16px;
}

/* ── FORM ── */
.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: .85rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #dadce0;
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  transition: border-color .15s;
}

.field input:focus { border-color: var(--primary); }

.field.readonly span {
  display: inline-block;
  padding: 10px 0;
  font-size: 1rem;
  font-weight: 500;
}

/* ── BUTTONS ── */
.btn-primary, .btn-secondary, .btn-text {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 500;
  transition: background .15s, opacity .15s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  padding: 12px 24px;
  width: 100%;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
  background: #e8f0fe;
  color: var(--primary);
  padding: 10px 20px;
}
.btn-secondary:hover { background: #d2e3fc; }

.btn-text {
  background: transparent;
  color: #fff;
  padding: 8px 12px;
}
.btn-text:hover { opacity: .8; }

/* ── FEEDBACK ── */
.error { color: var(--error); font-size: .9rem; margin-bottom: 12px; padding: 8px 12px; background: #fce8e6; border-radius: 6px; }
.msg   { font-size: .9rem; margin-top: 12px; padding: 8px 12px; border-radius: 6px; }
.msg.ok  { color: var(--success); background: #e6f4ea; }
.msg.err { color: var(--error);   background: #fce8e6; }

/* ── OFFLINE BANNER ── */
.offline-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #f9ab00;
  color: #202124;
  text-align: center;
  padding: 10px 16px;
  font-size: .9rem;
  font-weight: 500;
  z-index: 100;
}

@media (max-width: 400px) {
  .login-card { padding: 28px 20px; }
}
