@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

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

:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --bg:        #f0f2f8;
  --surface:   #ffffff;
  --surface-2: #f6f8fd;
  --surface-3: #eef0f7;
  --border:    #e2e6f0;
  --border-2:  #d0d6e8;
  --text:      #1a1d2e;
  --text-muted:#6b7280;
  --text-dim:  #9ca3af;
  --gold:      #b8891a;
  --gold-light:#d4a422;
  --accent:    #1e40af;
  --accent-2:  #3b82f6;
  --red:       #dc2626;
  --green:     #16a34a;
  --radius-sm: 6px;
  --radius:    12px;
  --radius-lg: 16px;
  --shadow:    0 4px 24px rgba(0,0,0,.07);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.05);
}

body { font-family: var(--font); -webkit-font-smoothing: antialiased; }
img  { max-width: 100%; height: auto; display: block; }
a    { text-decoration: none; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--surface-2); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }

/* ═══════════════════════════════
   SHARED FORM COMPONENTS
   ═══════════════════════════════ */
.form-group { margin-bottom: 1.2rem; }

.form-label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: .45rem;
  letter-spacing: .02em;
}

.form-control {
  width: 100%;
  padding: .75rem 1rem;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .95rem;
  font-family: var(--font);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  appearance: none;
}
.form-control:focus {
  border-color: var(--accent-2);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(59,130,246,.1);
}
.form-control::placeholder { color: var(--text-dim); }

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  width: 100%;
}
.btn-primary:hover {
  background: var(--accent-2);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(59,130,246,.25);
}
.btn-primary:active { transform: none; }

/* ALERTS */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  margin-bottom: 1.1rem;
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  line-height: 1.55;
}
.alert-danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--red);
}
.alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: var(--green);
}
.alert-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #d97706;
}

/* SESSION KICKED ALERT */
.alert-kicked {
  background: #fefce8;
  border: 1px solid #fde047;
  color: #854d0e;
  gap: .6rem;
  align-items: flex-start;
}
.alert-kicked strong { display: block; margin-bottom: .1rem; }

/* RELAY EXPIRY ALERT */
.alert-expiry {
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #c2410c;
  flex-direction: column;
  gap: .35rem;
  align-items: flex-start;
}
.alert-expiry .exp-icon { font-size: 1.6rem; line-height: 1; }
.alert-expiry .exp-title { font-size: 1rem; font-weight: 700; }
.alert-expiry .exp-detail {
  font-size: .82rem;
  color: #9a3412;
  line-height: 1.5;
}
.alert-expiry .exp-contact {
  margin-top: .25rem;
  font-size: .82rem;
  font-weight: 600;
  color: #c2410c;
}


/* ═══════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════ */
body.page-login {
  background: var(--bg);
  min-height: 100vh;
}

.login-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* Brand panel — intentionally dark */
.login-brand {
  background: linear-gradient(160deg, #0a0a1a 0%, #1a1a3e 60%, #0d1030 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  position: relative;
  overflow: hidden;
  border-right: 1px solid rgba(255,255,255,.06);
}
.login-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 40%, rgba(184,137,26,.14) 0%, transparent 70%);
  pointer-events: none;
}
.login-brand-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 0 20px rgba(184,137,26,.35));
}
.login-brand h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #f0ece4;
  text-align: center;
  line-height: 1.25;
  margin-bottom: .5rem;
}
.login-brand .brand-tagline {
  color: #c9a227;
  font-size: .85rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-align: center;
}
.brand-divider {
  width: 40px;
  height: 2px;
  background: #c9a227;
  margin: 1.5rem auto;
  border-radius: 2px;
  opacity: .5;
}
.login-brand .brand-info {
  color: #9a8f80;
  font-size: .85rem;
  text-align: center;
  line-height: 1.6;
  max-width: 260px;
}

/* Form panel — light */
.login-form-side {
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
}
.login-card { width: 100%; max-width: 400px; }
.login-card h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .35rem;
}
.login-card .login-subtitle {
  color: var(--text-muted);
  font-size: .88rem;
  margin-bottom: 2rem;
}


/* ═══════════════════════════════
   DASHBOARD PAGE — LIGHT
   ═══════════════════════════════ */
body.page-dashboard {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.site-header .header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: .9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
}
.site-header .header-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex-shrink: 0;
}
.site-header .header-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

/* Muharram decorative strips */
.muharram-ya-banner {
  background: url('../images/YaAli_YaHussain.png') repeat-x center;
  background-size: auto 100%;
  height: 52px;
  opacity: .85;
  border-bottom: 1px solid var(--border);
}
.muharram-symbols {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 72px;
  overflow: hidden;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.muharram-symbols .symbol-side {
  flex: 1;
  height: 72px;
  background: url('../images/Yahussain.png') repeat-x center;
  background-size: auto 56px;
  opacity: .55;
}
.muharram-symbols .symbol-center {
  height: 72px;
  flex-shrink: 0;
  padding: 0 12px;
  object-fit: contain;
}

.dashboard-main {
  flex: 1;
  padding: 1.75rem 1.5rem 5.5rem;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

/* User info bar */
.user-info-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.user-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  object-fit: cover;
  flex-shrink: 0;
}
.user-meta { flex: 1; min-width: 0; }
.user-meta .u-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-meta .u-its {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: .1rem;
}
.btn-logout {
  flex-shrink: 0;
  background: transparent;
  border: 1.5px solid var(--border-2);
  color: var(--text-muted);
  padding: .45rem .9rem;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-family: var(--font);
}
.btn-logout:hover {
  border-color: #fca5a5;
  color: var(--red);
  background: #fef2f2;
}

/* Stream card */
.stream-card {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: relative;
  padding-top: 56.25%;
}
.stream-card iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}
.stream-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .75rem;
  padding: 0 .25rem;
}
.live-dot {
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  animation: pulse-red 1.5s infinite;
  flex-shrink: 0;
}
@keyframes pulse-red {
  0%,100%{ opacity:1; transform:scale(1); }
  50%    { opacity:.5; transform:scale(1.3); }
}
.stream-label span {
  font-size: .78rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.site-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,.97);
  border-top: 1px solid var(--border);
  padding: .65rem 1.5rem;
  text-align: center;
  font-size: .78rem;
  color: var(--text-muted);
  z-index: 50;
}
.site-footer a { color: var(--gold); }
.site-footer a:hover { color: var(--gold-light); }


/* ═══════════════════════════════
   CHANGE PASSWORD PAGE — LIGHT
   ═══════════════════════════════ */
body.page-change-pw {
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.change-pw-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}
.change-pw-card .card-icon {
  width: 52px;
  height: 52px;
  background: rgba(59,130,246,.08);
  border: 1px solid rgba(59,130,246,.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  font-size: 1.4rem;
}
.change-pw-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .35rem;
}
.change-pw-card .card-desc {
  color: var(--text-muted);
  font-size: .87rem;
  line-height: 1.55;
  margin-bottom: 1.75rem;
}


/* ═══════════════════════════════
   RESPONSIVE
   ═══════════════════════════════ */
@media (max-width: 768px) {
  .login-wrapper  { grid-template-columns: 1fr; }
  .login-brand    { display: none; }
  .login-form-side {
    padding: 2.5rem 1.5rem;
    min-height: 100vh;
    background: var(--surface);
  }
  .dashboard-main { padding: 1.25rem 1rem 5rem; }
  .user-info-bar  { flex-wrap: wrap; }
  .btn-logout     { width: 100%; justify-content: center; margin-top: .25rem; }
}
@media (max-width: 480px) {
  .login-card h2 { font-size: 1.4rem; }
  .muharram-symbols .symbol-side { display: none; }
}
