/* =====================================================================
   Royal Interior UAE — App Mode Styles
   ===================================================================== */

body.app-body { background: #f7f5f1; padding-bottom: 88px; padding-top: 0; margin: 0; }
body.app-body .ri-header,
body.app-body .ri-footer,
body.app-body .ri-topbar,
body.app-body .ri-cta-band,
body.app-body .ri-wa-fab,
body.app-body .ri-wa-pop,
body.app-body #pwa-install-btn { display: none !important; }
body.app-body main { padding: 0; }

.app-header {
  background: #0e0e10; color: #fff;
  padding: 18px 20px;
  padding-top: calc(18px + env(safe-area-inset-top));
  display: flex; align-items: center; justify-content: space-between;
  border-bottom-left-radius: 20px; border-bottom-right-radius: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  position: sticky; top: 0; z-index: 100;
}
.app-header h1 {
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: 1.15rem; color: #fff; margin: 0; font-weight: 600;
}
.app-header a {
  color: #b89456; font-size: .8rem; text-transform: uppercase;
  text-decoration: none; font-weight: 600; letter-spacing: .05em;
}

.app-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff;
  padding: 8px 0;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  display: flex; justify-content: space-around;
  border-top: 1px solid #e5e5e5;
  box-shadow: 0 -2px 10px rgba(0,0,0,.05);
  z-index: 1000;
}
.app-nav a {
  display: flex; flex-direction: column; align-items: center;
  font-size: .7rem; color: #6b6b73;
  text-transform: uppercase; font-weight: 600;
  gap: 4px; padding: 6px 12px; text-decoration: none; border-radius: 10px;
  transition: background .2s, color .2s;
}
.app-nav a.active { color: #b89456; background: #fef9f0; }
.app-nav svg { width: 22px; height: 22px; }

.app-container {
  padding: 20px;
  padding-bottom: 20px;
  max-width: 640px; margin: 0 auto;
}
.app-card {
  background: #fff; border-radius: 16px;
  padding: 20px; margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,.04);
  border: 1px solid #e5e5e5;
}
.app-card h3 {
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: 1.1rem; margin: 0 0 8px; color: #0e0e10;
}
.app-card p { font-size: .88rem; color: #6b6b73; margin: 0 0 12px; }

.status-badge {
  display: inline-block; padding: 5px 12px;
  border-radius: 999px; font-size: .68rem;
  font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; white-space: nowrap;
}
.status-NEW { background: #e3f2fd; color: #1565c0; }
.status-CONTACTED { background: #fff3e0; color: #ef6c00; }
.status-SITE-VISIT { background: #f3e5f5; color: #7b1fa2; }
.status-QUOTATION-SENT { background: #e8f5e9; color: #2e7d32; }
.status-FOLLOW-UP { background: #fffde7; color: #f9a825; }
.status-APPROVED { background: #e8f5e9; color: #1b5e20; }
.status-IN-PROGRESS { background: #fff8e1; color: #f57f17; }
.status-COMPLETED { background: #e8f5e9; color: #1b5e20; }
.status-CANCELLED { background: #ffebee; color: #c62828; }

.app-timeline { margin-top: 20px; position: relative; padding-left: 26px; }
.app-timeline::before {
  content: ''; position: absolute; left: 7px; top: 10px; bottom: 10px;
  width: 2px; background: #e5e5e5;
}
.app-timeline-step { position: relative; margin-bottom: 16px; }
.app-timeline-step::before {
  content: ''; position: absolute; left: -26px; top: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #e5e5e5; border: 3px solid #fff;
}
.app-timeline-step.done::before { background: #b89456; }
.app-timeline-step strong { display: block; font-size: .9rem; color: #0e0e10; }
.app-timeline-step span { font-size: .75rem; color: #6b6b73; }

.app-form { display: flex; flex-direction: column; gap: 12px; }
.app-form input,
.app-form select,
.app-form textarea {
  padding: 14px 16px;
  border: 1px solid #e5e5e5; border-radius: 12px;
  font-size: 1rem; background: #fff;
  font-family: inherit; width: 100%; box-sizing: border-box;
  -webkit-appearance: none; appearance: none;
}
.app-form textarea { resize: vertical; min-height: 80px; }
.app-form input:focus,
.app-form select:focus,
.app-form textarea:focus {
  outline: none; border-color: #b89456;
  box-shadow: 0 0 0 3px rgba(184,148,86,.15);
}
.app-form button {
  padding: 16px; border-radius: 12px;
  background: #b89456; color: #0e0e10;
  font-weight: 700; border: 0; font-size: 1rem;
  cursor: pointer; font-family: inherit;
  transition: background .2s, transform .1s;
}
.app-form button:hover { background: #a37f4a; }
.app-form button:active { transform: scale(.98); }

.file-label {
  display: block; padding: 14px;
  border: 1.5px dashed #e5e5e5; border-radius: 12px;
  text-align: center; color: #6b6b73; font-size: .9rem;
  cursor: pointer; background: #fff;
}
.file-label:hover { border-color: #b89456; }
.file-label input { display: none; }

.login-tabs {
  display: flex; background: #e5e5e5; border-radius: 12px;
  padding: 4px; margin-bottom: 24px;
}
.login-tab {
  flex: 1; text-align: center; padding: 10px;
  border-radius: 8px; font-size: .9rem; font-weight: 600;
  color: #6b6b73; cursor: pointer;
  transition: all .2s; user-select: none;
}
.login-tab.active {
  background: #fff; color: #0e0e10;
  box-shadow: 0 2px 6px rgba(0,0,0,.1);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

.install-card {
  background: #0e0e10; color: #fff; text-align: center;
  padding: 20px; border-radius: 16px; margin-top: 24px;
}
.install-card h3 { color: #fff; font-size: 1.05rem; margin-bottom: 6px; }
.install-card p { color: rgba(255,255,255,.7); font-size: .82rem; margin-bottom: 14px; }
.install-btn {
  background: #b89456; color: #0e0e10;
  border: 0; padding: 14px 20px; border-radius: 12px;
  font-weight: 700; width: 100%; cursor: pointer;
  display: none; align-items: center; justify-content: center; gap: 8px;
  font-size: .95rem; font-family: inherit;
}
.install-btn:hover { background: #e0bd78; }

/* ============================================================
   Mobile tightening
   ============================================================ */
@media (max-width: 480px) {
  .app-container { padding: 16px; }
  .app-card { padding: 16px; border-radius: 14px; }
  .app-header { padding: 14px 16px; padding-top: calc(14px + env(safe-area-inset-top)); }
  .app-header h1 { font-size: 1.05rem; }
  .app-nav a { padding: 4px 8px; font-size: .65rem; }
  .app-nav svg { width: 20px; height: 20px; }
}

/* ============================================================
   Desktop — center the app in a phone-like frame
   ============================================================ */
@media (min-width: 768px) {
  body.app-body {
    background: linear-gradient(135deg, #0e0e10 0%, #1c1c22 100%);
    padding: 40px 0;
    display: flex; flex-direction: column; align-items: center;
  }
  body.app-body .app-header,
  body.app-body .app-container,
  body.app-body .app-nav {
    width: 100%; max-width: 480px;
  }
  body.app-body .app-header {
    border-radius: 24px 24px 0 0;
    position: static;
  }
  body.app-body .app-container {
    background: #f7f5f1;
    min-height: calc(100vh - 220px);
    max-height: 75vh;
    overflow-y: auto;
    border-radius: 0;
  }
  body.app-body .app-nav {
    position: static;
    border-radius: 0 0 24px 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,.3);
  }
}