/* ============================================================
   EAINDRA REMITTANCE — Global Styles
   Design: Premium Finance Display Board (TV-Optimised)
   ============================================================ */

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

/* ── CSS Variables ── */
:root {
  --bg:          #EEF2F7;
  --surface:     #FFFFFF;
  --surface-2:   #F8FAFD;
  --navy:        #0D1B3E;
  --navy-mid:    #1A2F5A;
  --blue:        #2563EB;
  --blue-light:  #EFF6FF;
  --gold:        #C9A028;
  --gold-light:  #FEF9EC;
  --red:         #DC2626;
  --red-light:   #FEF2F2;
  --green:       #059669;
  --text-1:      #0D1B3E;
  --text-2:      #4B5A74;
  --text-3:      #94A3B8;
  --border:      #E2E8F0;
  --shadow-sm:   0 1px 3px rgba(13,27,62,0.06), 0 1px 2px rgba(13,27,62,0.04);
  --shadow-md:   0 4px 16px rgba(13,27,62,0.08), 0 2px 6px rgba(13,27,62,0.05);
  --shadow-lg:   0 12px 40px rgba(13,27,62,0.10), 0 4px 12px rgba(13,27,62,0.06);
  --radius:      14px;
  --radius-sm:   8px;
  --font:        'Sora', sans-serif;
  --mono:        'DM Mono', monospace;
}

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

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-1);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

/* ── Background Texture ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(37,99,235,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 100%, rgba(201,160,40,0.05) 0%, transparent 55%),
    radial-gradient(ellipse 50% 70% at 50% 50%, rgba(13,27,62,0.02) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

body > * { position: relative; z-index: 1; }

/* ── Keyframes ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.8); }
}

@keyframes rate-flash {
  0%   { color: var(--blue); }
  50%  { color: var(--gold); }
  100% { color: var(--text-1); }
}

@keyframes ticker-scroll {
  0%   { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-4px); }
}

/* ── Utility ── */
.hidden { display: none !important; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
  overflow: auto;
}

.login-wrap {
  width: 100%;
  max-width: 420px;
  padding: 24px;
  animation: fadeUp 0.6s ease both;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 40px 40px;
  box-shadow: var(--shadow-lg);
}

.login-brand {
  text-align: center;
  margin-bottom: 36px;
}

.login-brand-icon {
  width: 56px;
  height: 56px;
  background: var(--navy);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.login-brand-icon svg {
  width: 28px;
  height: 28px;
  fill: var(--gold);
}

.login-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.3px;
  line-height: 1.3;
}

.login-sub {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
  letter-spacing: 0.3px;
}

.login-field {
  margin-bottom: 16px;
}

.login-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 7px;
}

.login-field input {
  width: 100%;
  height: 46px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-1);
  background: var(--surface-2);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  outline: none;
}

.login-field input:focus {
  border-color: var(--blue);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.10);
}

.login-error {
  background: var(--red-light);
  border: 1px solid rgba(220,38,38,0.2);
  color: var(--red);
  font-size: 12px;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  display: none;
  animation: fadeIn 0.3s ease;
}

.login-btn {
  width: 100%;
  height: 46px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  margin-top: 8px;
}

.login-btn:hover {
  background: var(--navy-mid);
  box-shadow: 0 4px 14px rgba(13,27,62,0.25);
  transform: translateY(-1px);
}

.login-btn:active { transform: translateY(0); }

/* ============================================================
   DASHBOARD — LAYOUT
   ============================================================ */
.dashboard-body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

/* ── Top Bar ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 72px;
  background: var(--navy);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.topbar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.topbar-brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.topbar-name {
  font-size: 20px;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -0.4px;
  line-height: 1.2;
}

.topbar-badge {
  font-size: 10px;
  font-weight: 500;
  color: var(--gold);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.topbar-datetime {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topbar-date {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  font-weight: 400;
  letter-spacing: 0.2px;
}

.topbar-time {
  font-size: 26px;
  font-weight: 700;
  color: #FFFFFF;
  font-family: var(--mono);
  letter-spacing: 1px;
  line-height: 1;
}

/* ── Main Content ── */
.main-content {
  flex: 1;
  overflow: hidden;
  padding: 20px 28px 10px;
  display: flex;
  flex-direction: column;
}

/* ── Cards Grid ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 14px;
  flex: 1;
  align-items: stretch;
}

/* ── Rate Card ── */
.rate-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  animation: fadeUp 0.6s ease forwards;
  transition: box-shadow 0.3s, transform 0.3s, border-color 0.3s;
  position: relative;
  overflow: hidden;
}

.rate-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--navy));
  opacity: 0;
  transition: opacity 0.3s;
}

.rate-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: rgba(37,99,235,0.15);
}

.rate-card:hover::before { opacity: 1; }

/* Stagger animation delays */
.rate-card:nth-child(1) { animation-delay: 0.05s; }
.rate-card:nth-child(2) { animation-delay: 0.10s; }
.rate-card:nth-child(3) { animation-delay: 0.15s; }
.rate-card:nth-child(4) { animation-delay: 0.20s; }
.rate-card:nth-child(5) { animation-delay: 0.25s; }
.rate-card:nth-child(6) { animation-delay: 0.30s; }
.rate-card:nth-child(7) { animation-delay: 0.35s; }

/* Card Header */
.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.flag-wrap {
  width: 32px;
  height: 22px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.flag-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
}

.country-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.2px;
  line-height: 1.2;
}

.currency-tag {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  letter-spacing: 0.3px;
}

/* Rate Section — single rate */
.rate-single {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rate-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.rate-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
  font-family: var(--mono);
  letter-spacing: -0.5px;
  line-height: 1;
  transition: color 0.5s ease;
}

.rate-value.updated {
  animation: rate-flash 0.8s ease;
}

.rate-myr {
  font-size: 10px;
  color: var(--text-3);
  font-weight: 400;
  margin-bottom: 2px;
}

/* Rate Section — dual rate (Myanmar/Bangladesh) */
.rate-dual {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rate-row {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 8px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.rate-row-label {
  font-size: 8px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

.rate-row-value {
  font-size: 17px;
  font-weight: 800;
  color: var(--navy);
  font-family: var(--mono);
  letter-spacing: -0.3px;
  line-height: 1;
  transition: color 0.5s ease;
}

.rate-row-value.updated {
  animation: rate-flash 0.8s ease;
}

/* Sparkline */
.sparkline-wrap {
  flex: 1;
  min-height: 44px;
  max-height: 54px;
  position: relative;
}

.sparkline-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Card Footer */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: auto;
}

.updated-time {
  font-size: 9px;
  color: var(--text-3);
  font-weight: 400;
  letter-spacing: 0.2px;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-dot 2s ease-in-out infinite;
  flex-shrink: 0;
}

/* ── Cached Banner ── */
.cached-banner {
  text-align: center;
  font-size: 11px;
  color: var(--text-3);
  padding: 4px 0 0;
  letter-spacing: 0.2px;
  display: none;
}

/* ── Bottom Bar ── */
.bottombar {
  height: 44px;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-shrink: 0;
  position: relative;
}

.bottombar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.support-icon {
  width: 14px;
  height: 14px;
  fill: var(--gold);
  flex-shrink: 0;
}

.support-text {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  font-weight: 400;
  letter-spacing: 0.2px;
}

.support-number {
  font-size: 14px;
  color: #FFFFFF;
  font-weight: 700;
  font-family: var(--mono);
  letter-spacing: 0.5px;
}

.support-sep {
  color: rgba(255,255,255,0.25);
  font-size: 16px;
  line-height: 1;
}

/* ============================================================
   MAINTENANCE PAGE
   ============================================================ */
.maintenance-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.maintenance-wrap {
  text-align: center;
  max-width: 520px;
  padding: 40px;
  animation: fadeUp 0.7s ease both;
}

.maintenance-icon-wrap {
  width: 80px;
  height: 80px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 28px;
  box-shadow: var(--shadow-md);
  animation: float 3s ease-in-out infinite;
}

.maintenance-icon-wrap svg {
  width: 38px;
  height: 38px;
}

.maintenance-brand {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.3px;
  margin-bottom: 20px;
  opacity: 0.6;
}

.maintenance-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.6px;
  line-height: 1.2;
  margin-bottom: 14px;
}

.maintenance-msg {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 32px;
  font-weight: 400;
}

.maintenance-divider {
  width: 48px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
  margin: 0 auto 28px;
}

.maintenance-support {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 28px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.maintenance-support svg {
  width: 18px;
  height: 18px;
  fill: var(--gold);
  flex-shrink: 0;
}

.maintenance-support-text {
  text-align: left;
}

.maintenance-support-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  line-height: 1;
  margin-bottom: 3px;
}

.maintenance-support-number {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  font-family: var(--mono);
  letter-spacing: 0.5px;
}
