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

:root {
  --red: rgb(227, 1, 15);
  --dark: rgb(68, 68, 68);
  --green-bg: #e8f5e9;
  --green-border: #4caf50;
  --yellow-bg: #fff8e1;
  --yellow-border: #ffc107;
}

body {
  font-family: 'Roboto Condensed', sans-serif;
  background: #f5f5f5;
  color: var(--dark);
  min-height: 100dvh;
  overflow-x: hidden;
}

/* Pages */
.page { display: none; min-height: 100dvh; }
.page.active { display: flex; flex-direction: column; }

/* App bar */
.app-bar {
  display: flex; align-items: center; gap: 12px;
  background: var(--red); color: #fff;
  padding: 12px 16px; font-size: 18px; font-weight: 700;
  position: sticky; top: 0; z-index: 10;
}
.menu-btn {
  background: none; border: none; color: #fff;
  font-size: 24px; cursor: pointer; padding: 0 4px;
}
.app-bar-title { flex: 1; }

/* Language bar */
.lang-bar {
  display: flex; justify-content: center; gap: 6px;
  background: var(--dark); padding: 12px 16px;
}
.lang-btn {
  background: rgba(255,255,255,.15); color: #fff; border: none;
  padding: 10px 18px; border-radius: 6px; font-size: 16px;
  font-family: inherit; font-weight: 700; cursor: pointer;
  line-height: 1;
}
.lang-btn.active {
  background: #fff; color: var(--red);
}
.lang-btn:hover { background: rgba(255,255,255,.3); }
.lang-btn.active:hover { background: #fff; }

/* Drawer */
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: 260px;
  background: var(--dark); color: #fff; z-index: 100;
  display: flex; flex-direction: column; padding: 24px 16px; gap: 16px;
  transition: transform .2s ease;
}
.drawer.hidden { transform: translateX(-100%); }
.drawer-org-name {
  align-self: stretch; margin: -24px -16px 8px;
  padding: 20px 16px;
  font-size: 20px; font-weight: 700; text-align: center;
  background: rgba(255,255,255,.1); border-bottom: 1px solid rgba(255,255,255,.15);
}
.drawer-item {
  background: none; border: none; color: #fff; font-size: 16px;
  text-align: left; padding: 10px 8px; cursor: pointer;
  font-family: inherit; border-radius: 4px;
}
.drawer-item:hover { background: rgba(255,255,255,.1); }
.install-btn { display: none; }
@media (max-width: 768px) { .install-btn { display: block; } }

.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 50;
}
.overlay.hidden { display: none; }

/* Login */
.login-container {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 24px; padding: 24px;
}
.version-badge {
  position: absolute; top: 12px; right: 16px;
  background: var(--dark); color: #fff; padding: 2px 10px;
  border-radius: 12px; font-size: 12px;
}
.google-cta {
  font-size: 16px; font-weight: 700; text-align: center;
  color: var(--dark); padding: 0 8px;
}
.btn-google {
  display: flex; align-items: center; gap: 12px;
  font-size: 18px; padding: 12px 32px;
}
.google-icon { width: 24px; height: 24px; }
.info-link { color: var(--red); font-size: 14px; cursor: pointer; text-decoration: none; }
.info-link:hover { text-decoration: underline; }

/* Buttons */
.btn-red {
  background: var(--red); color: #fff; border: none;
  padding: 12px 32px; border-radius: 8px; font-size: 16px;
  font-family: inherit; font-weight: 700; cursor: pointer;
}
.btn-red:disabled { opacity: .5; cursor: not-allowed; }

.btn-white {
  background: #fff; color: var(--dark); border: 2px solid #ddd;
  padding: 12px 32px; border-radius: 8px; font-size: 16px;
  font-family: inherit; font-weight: 700; cursor: pointer;
}

.btn-outline-red {
  background: #fff; color: var(--red); border: 2px solid var(--red);
  padding: 12px 32px; border-radius: 8px; font-size: 16px;
  font-family: inherit; font-weight: 700; cursor: pointer;
}

.btn-round {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--red); color: #fff; border: none;
  font-size: 22px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* Debit */
.debit-container {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; padding: 24px 16px; gap: 16px;
}
.debit-label { font-size: 18px; }
.debit-zero-msg {
  font-size: 17px; line-height: 1.5; text-align: center;
  color: var(--dark); padding: 16px 0;
}
.amount-row {
  display: flex; align-items: center; gap: 12px;
}
#debit-input {
  width: 100px; text-align: center; font-size: 20px;
  border: 2px solid #ccc; border-radius: 8px; padding: 8px;
  font-family: inherit; font-weight: 700;
  -moz-appearance: textfield;
}
#debit-input::-webkit-inner-spin-button,
#debit-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

#debit-slider {
  width: min(100%, 320px); accent-color: var(--red);
}
.debit-actions {
  display: flex; gap: 16px; margin-top: 8px;
}

/* Profile */
.profile-container {
  flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 16px;
}
.profile-info { font-size: 16px; padding: 0 4px; }

/* Cards */
.card {
  border-radius: 12px; padding: 16px; border-left: 4px solid;
}
.card-green { background: var(--green-bg); border-color: var(--green-border); }
.card-yellow { background: var(--yellow-bg); border-color: var(--yellow-border); }
.card-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 16px; font-weight: 700; margin-bottom: 12px;
}
.card-icon { font-size: 20px; }

.wallet-list { list-style: none; }
.wallet-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; border-bottom: 1px solid rgba(0,0,0,.08);
  font-size: 15px;
}
.wallet-list li:last-child { border-bottom: none; }
.wallet-amount { font-weight: 700; }
.wallet-empty { font-size: 14px; color: #888; }

/* Policy */
#page-policy.active { display: block; }
#page-policy .app-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 10; }
#policy-iframe {
  position: fixed; top: 48px; left: 0; right: 0; bottom: 58px;
  width: 100%; height: calc(100vh - 48px - 58px); border: none;
}
.policy-footer {
  position: fixed; bottom: 0; left: 0; right: 0; height: 58px;
  display: flex; align-items: center; justify-content: center;
  background: #f5f5f5; border-top: 1px solid #ddd;
  padding: 0 16px;
}
.policy-accept-btn {
  width: 100%; max-width: 400px;
  padding: 14px 32px; font-size: 18px;
}

/* Powered by */
.powered-by {
  position: fixed; bottom: 8px; right: 12px;
  font-size: 12px; color: #aaa; text-decoration: none;
  z-index: 5;
}
.powered-by:hover { color: var(--red); }

/* Modal */
#modal {
  border: none; border-radius: 12px; padding: 24px;
  max-width: 360px; width: 90%; text-align: center;
  margin: auto;
}
#modal::backdrop { background: rgba(0,0,0,.4); }
#modal h3 { margin-bottom: 12px; font-size: 20px; }
#modal p { margin-bottom: 20px; font-size: 15px; line-height: 1.5; white-space: pre-line; text-align: center; }
.modal-ok { min-width: 100px; }
