/* ============================================
   Rebhli — Main Stylesheet
   ============================================ */

:root {
  --bg: #FAF7F2;
  --bg-alt: #F2EDE4;
  --ink: #1A1815;
  --ink-soft: #000000;
  --ink-mute: #000000;
  --accent: #D4572A;
  --accent-dark: #B0441E;
  --accent-soft: #F5E1D3;
  --gold: #C79B4A;
  --line: #E5DDD0;
  --line-soft: #EFE9DD;
  --white: #FFFFFF;
  --success: #2E7D5B;
  --success-soft: #E1F0E8;
  --warning: #B87514;
  --warning-soft: #FEF3E0;
  --info: #1F5294;
  --info-soft: #E4EDF7;
  --danger: #B33838;
  --danger-soft: #F7E0E0;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Tajawal', sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  overflow-x: hidden;
  font-weight: 400;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.display { font-family: 'Reem Kufi', serif; font-weight: 600; letter-spacing: -0.02em; }
.heading { font-family: 'Cairo', sans-serif; font-weight: 800; letter-spacing: -0.01em; }

/* ===== Noise Texture Overlay ===== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===== Buttons ===== */
.btn {
  padding: 12px 24px;
  border-radius: 100px;
  font-family: 'Tajawal', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.25s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(212, 87, 42, 0.25);
}

.btn-accent {
  background: var(--accent);
  color: white;
}

.btn-accent:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(212, 87, 42, 0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
}

.btn-ghost:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

.btn-block { width: 100%; }

.btn-big { padding: 16px 32px; font-size: 16px; }

/* ===== Auth Pages (Login & Register) ===== */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
}

.auth-side {
  background: var(--ink);
  color: var(--bg);
  padding: 48px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.auth-side::before {
  content: '';
  position: absolute;
  top: -100px;
  left: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(212, 87, 42, 0.3) 0%, transparent 70%);
  filter: blur(60px);
}

.auth-side::after {
  content: '';
  position: absolute;
  bottom: -80px;
  right: -80px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(199, 155, 74, 0.2) 0%, transparent 70%);
  filter: blur(60px);
}

.auth-side-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-logo-mark {
  width: 44px;
  height: 44px;
  background: var(--accent);
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: white;
  font-family: 'Reem Kufi', serif;
  font-size: 22px;
  font-weight: 700;
  transform: rotate(-5deg);
  box-shadow: 3px 3px 0 rgba(212, 87, 42, 0.3);
}

.auth-logo-text {
  font-family: 'Reem Kufi', serif;
  font-size: 26px;
  font-weight: 700;
}

.auth-tagline {
  padding: 40px 0;
}

.auth-tagline h2 {
  font-family: 'Reem Kufi', serif;
  font-size: 44px;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 20px;
}

.auth-tagline h2 span {
  color: var(--accent);
  position: relative;
}

.auth-tagline p {
  font-size: 17px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.7;
  max-width: 420px;
}

.auth-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
}

.auth-feature-icon {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.auth-feature-icon svg {
  width: 16px;
  height: 16px;
  stroke: white;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* === Right side (form) === */
.auth-main {
  padding: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}

.auth-form-wrap {
  width: 100%;
  max-width: 440px;
}

.auth-form-head {
  margin-bottom: 32px;
}

.auth-form-head h1 {
  font-family: 'Reem Kufi', serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.auth-form-head p {
  color: var(--ink-soft);
  font-size: 15px;
}

/* === Form inputs === */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.form-group label .req {
  color: var(--accent);
  margin-right: 2px;
}

.form-input {
  width: 100%;
  padding: 14px 18px;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: 'Tajawal', sans-serif;
  font-size: 15px;
  color: var(--ink);
  transition: all 0.2s;
  outline: none;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(212, 87, 42, 0.08);
}

.form-input::placeholder {
  color: var(--ink-mute);
}

.form-input.error {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.form-hint {
  font-size: 12px;
  color: var(--ink-mute);
  margin-top: 6px;
}

.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 6px;
  font-weight: 600;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
}

.form-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--ink-mute);
}

.auth-footer a {
  color: var(--accent);
  font-weight: 700;
}

.auth-footer a:hover { text-decoration: underline; }

/* ===== Alerts ===== */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-right: 4px solid;
}

.alert svg { flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px; }

.alert-success {
  background: var(--success-soft);
  color: var(--success);
  border-color: var(--success);
}

.alert-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger);
}

.alert-warning {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: var(--warning);
}

.alert-info {
  background: var(--info-soft);
  color: var(--info);
  border-color: var(--info);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-side {
    padding: 32px 24px;
    min-height: auto;
  }
  .auth-tagline { padding: 24px 0; }
  .auth-tagline h2 { font-size: 32px; }
  .auth-features { display: none; }
  .auth-main { padding: 32px 24px; }
}

@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; }
  .auth-form-head h1 { font-size: 26px; }
}