/* App Hold Pages (Inside App View) Styles - Premium Native App Shell */

:root {
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: #f0f9ff;
  --bg: #f8fafc;
  --card: #ffffff;
  --card-border: #e2e8f0;
  --text-main: #0f172a;
  --text-sub: #334155;
  --text-muted: #64748b;
  --radius-lg: 1.25rem;
  --radius-md: 0.85rem;
  --max-w: 430px;
}

* {
  box-sizing: border-box;
}

body.app-screen-body {
  background: #cbd5e1;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  width: 100%;
  overflow-x: hidden;
}

/* Mobile App Canvas Frame */
.app-frame {
  width: 100%;
  max-width: var(--max-w);
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 30px rgba(0,0,0,0.15);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

/* On Real Mobile Phones (<= 480px): Edge-to-Edge Native Feel */
@media (max-width: 480px) {
  body.app-screen-body {
    background: var(--bg);
  }
  .app-frame {
    max-width: 100%;
    box-shadow: none;
  }
}

/* App Header Bar */
.app-header {
  background: #ffffff;
  border-bottom: 1px solid var(--card-border);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 20;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.user-avatar {
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 50%;
  background: #f1f5f9;
  color: #64748b;
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  flex-shrink: 0;
}

.user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-greeting {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.user-name {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-badge {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #c2410c;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

/* Main Content Area */
.app-content {
  flex: 1;
  padding: 1rem 1rem 1.5rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Hero Registration Card */
.hero-reg-card {
  background: linear-gradient(135deg, #ffffff 0%, var(--primary-light) 100%);
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.12);
  position: relative;
  overflow: hidden;
}

.hero-reg-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.65rem;
  text-transform: uppercase;
}

.hero-reg-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1.2;
  margin: 0 0 0.25rem 0;
  letter-spacing: -0.02em;
}

.hero-reg-subtitle {
  font-size: 0.8rem;
  color: var(--text-sub);
  font-weight: 600;
  margin: 0 0 1rem 0;
  line-height: 1.35;
}

/* Quick Balance Banner */
.wallet-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.1rem;
  color: #ffffff;
  margin-bottom: 1.1rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.15);
}

.wallet-label {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.wallet-balance {
  font-size: 1.75rem;
  font-weight: 900;
  color: #ffffff;
  margin: 0.2rem 0 0.85rem;
  letter-spacing: -0.02em;
}

.wallet-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.wallet-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 0.6rem;
  padding: 0.45rem 0.3rem;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
}

.wallet-btn svg {
  width: 1rem;
  height: 1rem;
}

/* Phone Input Form */
.input-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.phone-input-wrap {
  display: flex;
  align-items: center;
  border: 2px solid #cbd5e1;
  border-radius: var(--radius-md);
  background: #ffffff;
  overflow: hidden;
  margin-bottom: 0.85rem;
  transition: border-color 0.2s;
}

.phone-input-wrap:focus-within {
  border-color: var(--primary);
}

.country-code {
  padding: 0.75rem 0.6rem;
  background: #f1f5f9;
  border-right: 1px solid #cbd5e1;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-sub);
  flex-shrink: 0;
}

.phone-field {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  padding: 0.75rem 0.6rem;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text-main);
  font-family: inherit;
}

.action-btn-hold {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  height: 3.2rem;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.98rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
}

.action-btn-hold:active {
  transform: scale(0.98);
}

/* Service Grid */
.section-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 0.65rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.service-item {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
  cursor: pointer;
}

.service-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: #f1f5f9;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.service-icon svg {
  width: 1.1rem;
  height: 1.1rem;
}

.service-lbl {
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--text-sub);
}

/* History / Activity List */
.activity-list {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.activity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid #f1f5f9;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.activity-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #f0fdf4;
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.activity-text strong {
  display: block;
  font-size: 0.78rem;
  color: var(--text-main);
}

.activity-text span {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.activity-amount {
  font-size: 0.82rem;
  font-weight: 800;
  color: #16a34a;
  white-space: nowrap;
}

/* Bottom Navigation Bar */
.bottom-nav {
  position: relative;
  flex-shrink: 0;
  height: calc(3.8rem + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: #ffffff;
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 20;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
}

.nav-item.active {
  color: var(--primary);
}

.nav-item svg {
  width: 1.3rem;
  height: 1.3rem;
}

/* Registration Modal Overlay */
.reg-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.reg-modal-card {
  width: 100%;
  background: #ffffff;
  border-top-left-radius: 1.5rem;
  border-top-right-radius: 1.5rem;
  padding: 1.5rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 30px rgba(0,0,0,0.2);
  position: relative;
  box-sizing: border-box;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: #f1f5f9;
  border: none;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: 800;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-box-clean {
  text-align: center;
  padding: 1.25rem 0.5rem;
}

.loader-spinner-clean {
  width: 2.8rem;
  height: 2.8rem;
  border: 3.5px solid #e2e8f0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 0.85rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Small screen tweaks (iPhone SE / 320px-360px) */
@media (max-width: 360px) {
  .hero-reg-title {
    font-size: 1.1rem;
  }
  .hero-reg-subtitle {
    font-size: 0.75rem;
  }
  .action-btn-hold {
    height: 2.9rem;
    font-size: 0.9rem;
  }
  .services-grid {
    gap: 0.35rem;
  }
  .service-lbl {
    font-size: 0.6rem;
  }
}
