/* =========================================================
   ResHouse Manager – Shared Design System
   Matches Flutter AppColors + AppTypography exactly
   ========================================================= */

/* --- Google Font ----------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&display=swap');

/* --- CSS Custom Properties (mirroring AppColors) --------- */
:root {
  --primary:        #0F3451;
  --primary-light:  #1E6093;
  --primary-dark:   #0F2638;
  --accent:         #D4AF37;
  --accent-light:   #F3E5AB;
  --accent-dim:     rgba(212, 175, 55, 0.15);

  --success:        #198754;
  --warning:        #FFC107;
  --danger:         #DC3545;
  --info:           #0D6EFD;

  --bg:             #F8F9FA;
  --card:           #FFFFFF;
  --surface:        #F1F3F5;
  --border:         #DEE2E6;
  --text-primary:   #212529;
  --text-secondary: #6C757D;
  --text-on-dark:   #F8F9FA;

  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  --shadow-sm:  0 1px 4px rgba(0,0,0,.08);
  --shadow-md:  0 4px 16px rgba(15,52,81,.12);
  --shadow-lg:  0 8px 32px rgba(15,52,81,.18);

  --nav-h: 72px;
  --transition: 0.25s cubic-bezier(.4,0,.2,1);
}

/* --- Reset & Base --------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Tajawal', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  direction: rtl;
  line-height: 1.7;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a  { color: inherit; text-decoration: none; }

/* --- Utility ------------------------------------------- */
.container {
  width: 100%;
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: 20px;
}

.section { padding-block: 80px; }
.section-sm { padding-block: 48px; }

.text-center { text-align: center; }

.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  letter-spacing: 0.03em;
  margin-bottom: 14px;
}

/* --- Buttons ------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Tajawal', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  white-space: nowrap;
  line-height: 1;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-accent {
  background: var(--accent);
  color: var(--primary-dark);
  box-shadow: 0 4px 16px rgba(212,175,55,.35);
}
.btn-accent:hover {
  background: #c9a42e;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(212,175,55,.45);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
}

.btn-ghost {
  background: rgba(255,255,255,.12);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,.3);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover {
  background: rgba(255,255,255,.22);
  transform: translateY(-2px);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: #b02a37;
  transform: translateY(-2px);
}

.btn-whatsapp {
  background: #25D366;
  color: #fff;
  box-shadow: 0 4px 16px rgba(37,211,102,.3);
}
.btn-whatsapp:hover {
  background: #1fb855;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37,211,102,.4);
}

.btn-lg { padding: 16px 36px; font-size: 1.1rem; }
.btn-sm { padding: 10px 20px; font-size: 0.9rem; }
.btn-full { width: 100%; }

/* --- Cards --------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 28px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

/* --- Navbar -------------------------------------------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.brand-name {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--primary);
  max-width: 170px;
  line-height: 1.3;
}
.brand-tagline {
  font-size: 0.62rem;
  color: var(--text-secondary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}
.nav-links a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
.nav-links a:hover {
  background: var(--surface);
  color: var(--primary);
}
.nav-links .btn { padding: 9px 18px; font-size: 0.88rem; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--primary);
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    inset-inline: 0;
    flex-direction: column;
    align-items: stretch;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 16px 20px 24px;
    gap: 4px;
    box-shadow: var(--shadow-md);
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 12px 14px; border-radius: var(--radius-sm); }
  .nav-links .btn { text-align: center; margin-top: 8px; }
}

/* --- Footer -------------------------------------------- */
.footer {
  background: var(--primary-dark);
  color: var(--text-on-dark);
  padding-block: 56px 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.footer-brand .brand-logo {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}
.footer-brand p {
  font-size: 0.86rem;
  color: rgba(255,255,255,.55);
  max-width: 240px;
  line-height: 1.9;
}

.footer-col h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 16px;
  letter-spacing: 0.03em;
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul a {
  font-size: 0.86rem;
  color: rgba(255,255,255,.6);
  transition: color var(--transition);
}
.footer-col ul a:hover { color: #fff; }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 28px;
  font-size: 0.82rem;
  color: rgba(255,255,255,.4);
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

/* --- Notice / Alert box -------------------------------- */
.notice {
  background: #fff8e1;
  border-right: 4px solid var(--warning);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.notice-danger {
  background: #fff5f5;
  border-right-color: var(--danger);
  background: #fff5f5;
}
.notice-info {
  background: #e8f4fd;
  border-right-color: var(--info);
}
.notice ul { padding-right: 20px; }
.notice li { margin-bottom: 6px; font-size: 0.92rem; }

/* --- Page layout (sub-pages) --------------------------- */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.page-wrapper main { flex: 1; }

.page-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  padding: 64px 0 52px;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.page-hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 900;
  margin-bottom: 12px;
  position: relative;
}
.page-hero p {
  font-size: 1rem;
  opacity: .8;
  max-width: 560px;
  margin-inline: auto;
  position: relative;
}

.page-content {
  max-width: 820px;
  margin-inline: auto;
  padding: 60px 20px;
}
.page-content .card { margin-bottom: 20px; }
.page-content .card:hover { transform: none; box-shadow: var(--shadow-sm); }
.page-content h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent-dim);
}
.page-content p { margin-bottom: 12px; color: var(--text-secondary); font-size: 0.95rem; }
.page-content ul, .page-content ol {
  padding-right: 22px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}
.page-content li { margin-bottom: 8px; }
.page-content strong { color: var(--text-primary); }

/* --- Delete account form ------------------------------- */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 7px;
  color: var(--text-primary);
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: 'Tajawal', sans-serif;
  font-size: 0.95rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input { direction: ltr; text-align: right; }
.form-group textarea {
  resize: vertical;
  min-height: 110px;
  direction: rtl;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15,52,81,.1);
}

/* --- Fade-in (scroll animations) ----------------------- */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-up.visible { opacity: 1; transform: none; }

/* --- Scroll to top ------------------------------------- */
#scroll-top {
  position: fixed;
  bottom: 28px;
  left: 28px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition), background var(--transition);
  z-index: 900;
}
#scroll-top.show { opacity: 1; pointer-events: auto; }
#scroll-top:hover { transform: translateY(-3px); background: var(--primary-light); }

/* --- Steps (numbered list) ----------------------------- */
.steps { list-style: none; padding: 0; }
.steps li {
  display: flex;
  gap: 14px;
  margin-bottom: 16px;
  align-items: flex-start;
}
.step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  margin-top: 2px;
}

/* --- Multi-Platform Downloads & Badges ------------------ */
.badge-coming-soon {
  position: absolute;
  top: -8px;
  left: -8px;
  background: linear-gradient(135deg, #e67e22, #d35400);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(230, 126, 34, 0.4);
  letter-spacing: 0.03em;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.badge-dev {
  background: rgba(212, 175, 55, 0.2);
  color: #d4af37;
  border: 1px solid rgba(212, 175, 55, 0.4);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

.badge-live {
  background: rgba(25, 135, 84, 0.15);
  color: #198754;
  border: 1px solid rgba(25, 135, 84, 0.3);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.platform-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  text-decoration: none;
  color: var(--text-primary);
}

.platform-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.platform-card.is-coming-soon {
  cursor: pointer;
  opacity: 0.9;
}

.platform-card.is-coming-soon:hover {
  border-color: #e67e22;
}

.platform-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 14px;
}

.platform-card-icon.apple { background: rgba(0, 0, 0, 0.06); color: #000; }
.platform-card-icon.android { background: rgba(61, 220, 132, 0.12); color: #3ddc84; }
.platform-card-icon.web-prod { background: rgba(15, 52, 81, 0.12); color: var(--primary); }
.platform-card-icon.windows { background: rgba(0, 120, 215, 0.12); color: #0078d7; }
.platform-card-icon.web-dev { background: rgba(212, 175, 55, 0.15); color: var(--accent); }

.platform-card h3 {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.platform-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 18px;
  flex: 1;
}

.platform-card-btn {
  width: 100%;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  transition: background var(--transition), transform var(--transition);
}

.btn-apple { background: #000; color: #fff; }
.btn-apple:hover { background: #222; }

.btn-android { background: #34a853; color: #fff; }
.btn-android:hover { background: #2d9248; }

.btn-web { background: var(--primary); color: #fff; }
.btn-web:hover { background: var(--primary-light); }

.btn-windows { background: #0078d7; color: #fff; }
.btn-windows:hover { background: #0063b1; }

.btn-dev { background: linear-gradient(135deg, #1e6093, #0f3451); color: #d4af37; border: 1px solid rgba(212, 175, 55, 0.4); }
.btn-dev:hover { background: #0f3451; }

/* --- Toast Notifications -------------------------------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
  width: calc(100% - 32px);
}

.custom-toast {
  background: var(--card);
  border-right: 4px solid #e67e22;
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.custom-toast .toast-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.custom-toast .toast-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.custom-toast .toast-content strong {
  font-size: 0.92rem;
  color: var(--text-primary);
}

.custom-toast .toast-content span {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.custom-toast .toast-close {
  background: transparent;
  border: none;
  font-size: 1.3rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.custom-toast .toast-close:hover {
  color: var(--text-primary);
}

.fade-in {
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.fade-out {
  animation: toastOut 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(16px) scale(0.96); }
}

