:root {
  --brand-blue: #1872b9;
  --brand-green: #44b849;
  --brand-red: #d83a34;
  --ink: #223041;
  --bg-top: #eef5fb;
  --bg-bottom: #f4f7f8;
  --card-bg: #ffffff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: Arial, sans-serif;
  background: linear-gradient(180deg, var(--bg-top) 0%, #f8fbfe 30%, var(--bg-bottom) 100%);
  color: var(--ink);
}

.app-shell {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom)) 10px;
}

.screen {
  display: none;
  width: 100%;
  max-width: 430px;
}

.screen.active {
  display: flex;
  align-items: stretch;
}

.card {
  width: 100%;
  min-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  background: var(--card-bg);
  border-radius: 22px;
  padding: 14px 16px;
  box-shadow: 0 12px 35px rgba(24, 114, 185, 0.12);
  border: 1px solid rgba(24, 114, 185, 0.10);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.app-card {
  justify-content: flex-start;
}

.brand-logo {
  display: block;
  width: 100%;
  margin: 0 auto 10px;
  border-radius: 14px;
}

.loading-logo, .login-logo {
  max-width: 250px;
}

.home-logo {
  max-width: 210px;
  max-height: 96px;
  object-fit: contain;
  margin-bottom: 6px;
}

h1 {
  margin: 0 0 6px;
  font-size: clamp(24px, 4.2vw, 34px);
  line-height: 1.05;
  color: var(--ink);
}

label {
  display: block;
  margin-top: 10px;
  margin-bottom: 4px;
  font-weight: 700;
  font-size: 15px;
}

input {
  width: 100%;
  padding: 12px;
  border: 1px solid #cfd8e3;
  border-radius: 14px;
  font-size: 16px;
  background: #fff;
}

.btn {
  width: 100%;
  border: 0;
  border-radius: 16px;
  padding: 13px;
  margin-top: 10px;
  font-size: 18px;
  font-weight: 700;
  transition: transform 0.08s ease, opacity 0.2s ease;
}

.btn:active { transform: scale(0.99); }

.btn-small {
  width: auto;
  padding: 10px 14px;
  font-size: 14px;
  margin-top: 0;
  flex-shrink: 0;
}

.brand-blue { background: var(--brand-blue); color: #fff; }
.brand-green { background: var(--brand-green); color: #fff; }
.brand-red { background: var(--brand-red); color: #fff; }
.brand-orange { background: #f39c12; color: #fff; }
.pale-blue { background: #8db9df; color: #eef6fd; }
.pale-green { background: #a8dca9; color: #f5fff5; }
.pale-red { background: #f1a09a; color: #fff7f6; }
.pale-orange { background: #f7c97b; color: #fffaf2; }

.header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.compact-line {
  margin: 0;
  line-height: 1.15;
  font-size: 13px;
  color: #526172;
}

.muted {
  color: #526172;
}

.message {
  min-height: 18px;
  color: var(--brand-red);
  font-size: 14px;
  margin-top: 8px;
}

.action-block {
  margin-top: 8px;
}

.action-btn {
  font-size: clamp(20px, 5vw, 28px);
  padding: 16px;
  margin-top: 0;
}

.time-note {
  padding-top: 6px;
  font-size: 13px;
  color: #4b5a6b;
  text-align: center;
  min-height: 22px;
}

.utility-btn {
  font-size: 15px;
  padding: 12px;
  margin-top: 10px;
}

.action-message {
  margin-top: 10px;
  min-height: 18px;
  font-weight: 700;
  color: var(--brand-blue);
  font-size: 14px;
  text-align: center;
}

.hidden-fields {
  display: none;
}

@media (max-height: 760px) {
  .card { padding: 12px 14px; }
  .home-logo { max-width: 180px; max-height: 82px; margin-bottom: 4px; }
  h1 { font-size: 24px; }
  .compact-line { font-size: 12px; }
  .btn { padding: 11px; }
  .action-btn { padding: 13px; font-size: 22px; }
  .time-note, .action-message { font-size: 12px; }
}

@media (max-height: 680px) {
  .home-logo { max-width: 150px; max-height: 70px; }
  h1 { font-size: 22px; }
  .btn-small { padding: 8px 12px; font-size: 13px; }
  .action-btn { font-size: 20px; padding: 11px; }
  .utility-btn { font-size: 14px; padding: 10px; }
}
