/* =============================================
   MADC DESIGN SYSTEM
   ============================================= */

:root {
  --color-black:  #000000;
  --color-body2:  #5e5e5e;
  --color-body3:  #929292;
  --color-white:  #ffffff;
  --color-border: #e0e0e0;
  --color-banner: #8f8f8f;

  --font-base:    "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono:    "Courier New", Courier, monospace;

  --text-h2:      25px;
  --text-h3:      20px;
  --text-h4:      17px;
  --text-caption: 12px;
  --text-body1:   12px;
  --text-body2:   12px;
  --text-body3:   9px;
  --text-body5:   11px;

  --weight-light:   300;
  --weight-regular: 400;
  --weight-bold:    700;

  --max-width: 1200px;
  --header-h:  80px;
}

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

body {
  font-family: var(--font-base);
  font-size: var(--text-body1);
  font-weight: var(--weight-light);
  color: var(--color-black);
  background: var(--color-white);
}

a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; }

/* --- TYPOGRAPHY --- */
h2 {
  font-size: var(--text-h2);
  font-weight: var(--weight-bold);
  color: var(--color-black);
  text-transform: uppercase;
  line-height: 1.2;
}
h3 {
  font-size: var(--text-h3);
  font-weight: var(--weight-bold);
  color: var(--color-black);
  text-transform: capitalize;
  line-height: 1.3;
}
h4 {
  font-size: var(--text-h4);
  font-weight: var(--weight-bold);
  color: var(--color-black);
  font-variant: small-caps;
  line-height: 1.3;
}
.caption {
  font-size: var(--text-caption);
  font-weight: var(--weight-bold);
  color: var(--color-black);
  text-transform: capitalize;
}
.body1 {
  font-size: var(--text-body1);
  font-weight: var(--weight-light);
  color: var(--color-black);
  line-height: 1.6;
}
.body2 {
  font-size: var(--text-body2);
  font-weight: var(--weight-light);
  color: var(--color-body2);
  line-height: 1.6;
}
.body3 {
  font-size: var(--text-body3);
  font-weight: var(--weight-light);
  color: var(--color-body3);
  line-height: 1.5;
}
.body5 {
  font-family: var(--font-mono);
  font-size: var(--text-body5);
  font-weight: var(--weight-regular);
  color: var(--color-body3);
  line-height: 1.5;
}
p {
  font-size: var(--text-body1);
  font-weight: var(--weight-light);
  color: var(--color-black);
  line-height: 1.6;
}

/* --- LAYOUT --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn-s {
  display: inline-block;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}
.btn-s img {
  height: 40px;
  width: auto;
  display: block;
}
.btn-b {
  display: block;
  width: 100%;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  margin-bottom: 10px;
}
.btn-b img {
  width: 100%;
  height: auto;
  display: block;
}

/* =============================================
   HEADER
   ============================================= */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  z-index: 1000;
  display: flex;
  align-items: center;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.logo img {
  height: 50px;
  width: auto;
}

/* NAV */
.nav-list {
  display: flex;
  gap: 40px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-item {
  position: relative;
  font-size: var(--text-h4);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  padding: 28px 0;
  cursor: pointer;
}
.nav-item > a,
.nav-item > span {
  color: var(--color-black);
}

/* DROPDOWN */
.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--color-white);
  min-width: 280px;
  list-style: none;
  padding: 12px 0;
  margin: 0;
  border: 1px solid var(--color-border);
  z-index: 999;
}
.dropdown li a {
  display: block;
  padding: 8px 20px;
  font-size: var(--text-body2);
  font-weight: var(--weight-light);
  color: var(--color-body2);
  white-space: nowrap;
}
.dropdown li a:hover { color: var(--color-black); }
.has-dropdown:hover .dropdown { display: block; }

/* MOBILE TOGGLE */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: var(--text-caption);
  font-weight: var(--weight-bold);
  color: var(--color-black);
  cursor: pointer;
  letter-spacing: 0.08em;
}

/* =============================================
   BANNER
   ============================================= */
.banner {
  margin-top: var(--header-h);
  width: 100%;
  height: 220px;
  background: var(--color-banner);
  overflow: hidden;
}
.banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =============================================
   MAIN
   ============================================= */
main {
  padding: 60px 0;
  min-height: 60vh;
}

/* =============================================
   MODAL SHELL
   ============================================= */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal-box {
  background: var(--color-white);
  max-width: 560px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 40px;
}

/* =============================================
   FOOTER
   ============================================= */
footer {
  background: var(--color-white);
  border-top: 1px solid var(--color-border);
  padding-top: 36px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 32px;
}
.footer-left { flex: 0 0 52%; }
.footer-company {
  font-size: var(--text-body3);
  font-weight: var(--weight-light);
  color: var(--color-black);
  line-height: 1.7;
  margin-bottom: 2px;
}
.footer-company strong { font-weight: var(--weight-bold); }
.footer-address,
.footer-contact {
  font-size: var(--text-body3);
  font-weight: var(--weight-light);
  color: var(--color-black);
  line-height: 1.7;
}
.footer-contact a { color: var(--color-black); }
.footer-contact a:hover { text-decoration: underline; }
.footer-copy {
  font-size: var(--text-body3);
  font-weight: var(--weight-light);
  color: var(--color-black);
  line-height: 1.7;
  margin-top: 14px;
}
.footer-social {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}
.footer-social a img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.footer-right {
  flex: 0 0 44%;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.footer-link-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.footer-link-group a {
  font-size: var(--text-body3);
  font-weight: var(--weight-light);
  color: var(--color-black);
  line-height: 1.9;
}
.footer-link-group a:hover { color: var(--color-body2); }
.footer-legal {
  border-top: 1px solid var(--color-border);
  padding: 14px 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}
.footer-legal a {
  font-size: var(--text-body3);
  font-weight: var(--weight-light);
  color: var(--color-black);
}
.footer-legal a:hover { color: var(--color-body2); }
.footer-legal .sep {
  font-size: var(--text-body3);
  color: var(--color-body3);
  margin: 0 10px;
}

/* =============================================
   TERMS OF SERVICE
   ============================================= */
.tos-body { padding: 0; }
.tos-section {
  margin-bottom: 32px;
}
.tos-section p {
  margin-bottom: 8px;
}
.tos-section ul {
  list-style: disc;
  padding-left: 24px;
  margin-top: 6px;
}
.tos-section ul li {
  font-size: var(--text-body1);
  font-weight: var(--weight-light);
  color: var(--color-black);
  line-height: 1.7;
  margin-bottom: 4px;
}
.tos-heading {
  font-size: var(--text-h4);
  font-weight: var(--weight-bold);
  color: var(--color-black);
  margin-bottom: 12px;
  margin-top: 4px;
  display: block;
}
.tos-last-updated {
  margin-top: 48px;
  text-align: right;
  font-size: var(--text-body3);
  font-weight: var(--weight-light);
  color: var(--color-body3);
  line-height: 1.7;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
  :root { --header-h: 60px; }
  .container { padding: 0 20px; }
  .banner { height: 160px; }

  .nav-list {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--color-white);
    flex-direction: column;
    padding: 8px 0;
    border-top: 1px solid var(--color-border);
    text-align: right;
    z-index: 999;
  }
  .nav-list.mobile-open { display: flex; }
  .nav-item {
    padding: 6px 20px;
    font-size: var(--text-caption);
  }
  .dropdown {
    display: block;
    position: static;
    border: none;
    padding: 0;
    min-width: unset;
  }
  .dropdown li a {
    padding: 3px 20px;
    text-align: right;
    font-size: var(--text-caption);
  }
  .nav-toggle { display: block; }

  .footer-inner { flex-direction: row; }
  .footer-left  { flex: 0 0 52%; }
  .footer-right { flex: 0 0 44%; }
  .footer-legal { flex-wrap: wrap; gap: 4px; }
  .footer-legal .sep { margin: 0 6px; }

  .btn-s img { height: 36px; }
}
/* =============================================
   STRICT AUTHENTICATION UI (Pixel-Perfect)
   ============================================= */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #f4f4f4; /* Subtle background to make the white card pop */
  padding: 20px;
  font-family: var(--font-base);
}

.auth-card {
  background: #ffffff;
  width: 100%;
  max-width: 460px; /* Exact width control */
  padding: 40px 40px 0 40px; /* Bottom padding is 0 to let the banner touch the edge */
  box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.08); /* Soft, wide drop shadow */
  position: relative;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* Top Navigation (< back | X ) */
.auth-top-nav {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #929292;
  margin-bottom: 30px;
  text-transform: lowercase;
}
.auth-top-nav a { color: #929292; text-decoration: none; }
.auth-top-nav a:hover { color: #000000; }

/* Portal Header (Sign In Page) */
.auth-portal-header {
  display: flex;
  align-items: center;
  margin-bottom: 30px;
}
.auth-portal-header img {
  width: 80px;
  height: auto;
  margin-right: 15px;
}
.portal-title {
  font-size: 15px;
  font-weight: 700;
  color: #000000;
  margin-bottom: 4px;
}
.portal-subtitle {
  font-size: 18px;
  font-weight: 300;
  color: #5e5e5e;
}

/* Standard Centered Headers */
.auth-title-center {
  font-size: 16px;
  font-weight: 700;
  color: #000000;
  text-align: center;
  margin-bottom: 15px;
}
.auth-desc-center {
  font-size: 13px;
  font-weight: 300;
  color: #000000;
  text-align: center;
  margin-bottom: 25px;
}

/* Form Elements */
.auth-form-group {
  margin-bottom: 18px;
}
.auth-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: #000000;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.auth-input {
  width: 100%;
  height: 42px;
  padding: 0 20px;
  border: 1px solid #dcdcdc;
  border-radius: 25px; /* Pill-shaped inputs */
  font-size: 13px;
  font-family: var(--font-base);
  color: #000000;
  box-sizing: border-box;
  outline: none;
}
.auth-input::placeholder { color: #a0a0a0; }
.auth-input:focus { border-color: #000000; }

/* Image Buttons */
.auth-img-btn {
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  display: block;
  margin-bottom: 15px;
}
.auth-img-btn img {
  width: 100%;
  height: auto;
  display: block;
}

/* Dividers & Links */
.auth-divider {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #000000;
  margin: 15px 0;
}
.auth-links-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #000000;
  margin-top: 5px;
}
.auth-links-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.auth-links-row a { color: #000000; text-decoration: none; }
.auth-create-link {
  display: block;
  text-align: right;
  font-size: 12px;
  font-weight: 700;
  color: #000000;
  text-decoration: none;
  margin-top: 20px;
  margin-bottom: 20px;
}

/* reCAPTCHA Box */
.auth-recaptcha {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #dcdcdc;
  border-radius: 4px;
  padding: 10px 15px;
  margin-bottom: 20px;
  background: #fafafa;
}
.auth-recaptcha label {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Help Box (Forgot Password) */
.auth-help-box {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 20px;
  margin-bottom: 40px;
}
.auth-help-box img { width: 50px; height: auto; flex-shrink: 0; }
.auth-help-box p {
  font-size: 10px;
  color: #929292;
  line-height: 1.5;
}
.auth-help-box a { color: #929292; text-decoration: underline; }

/* Bottom Banner & Security Text */
.auth-banner-container {
  margin: 20px -40px 0 -40px; /* Pulls the image flush to the left, right, and bottom edges */
  position: relative;
}
.auth-banner-container img {
  width: 100%;
  height: auto;
  display: block;
}
.auth-security-text {
  position: absolute;
  bottom: 15px;
  left: 40px;
  right: 40px;
  font-size: 9px;
  color: #929292;
  line-height: 1.4;
}
.auth-security-text a { color: #929292; text-decoration: underline; }
/* =============================================
   DASHBOARD UI (Pixel-Perfect & Tab Logic)
   ============================================= */
.dashboard-wrapper {
  max-width: 1000px;
  margin: 40px auto;
  padding: 0;
  font-family: var(--font-base);
}

/* Header */
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding: 0 10px;
}
.dash-title h1 { font-size: 18px; font-weight: 700; color: #000; text-transform: uppercase; margin-bottom: 4px; }
.dash-title h2 { font-size: 16px; font-weight: 300; color: #5e5e5e; }
.dash-controls a { font-size: 16px; margin-left: 20px; cursor: pointer; font-weight: 700; color: #000; text-decoration: none; }

/* Top Cards */
.dash-top-cards {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}
.dash-card {
  background: #fff;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  border: 1px solid #eaeaea;
}
.card-account { flex: 2; display: flex; flex-direction: column; }
.account-header { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; }
.account-header img.avatar { width: 45px; height: 45px; }
.account-header h2 { font-size: 16px; font-weight: 700; color: #000; }
.account-header img.gear { width: 24px; height: 24px; margin-left: auto; }
.account-body { display: flex; gap: 20px; align-items: flex-end; }
.account-body img.db-icon { width: 55px; height: auto; margin-bottom: 5px; }
.account-form { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.account-form .form-group { display: flex; align-items: center; }
.account-form label { width: 90px; font-size: 11px; font-weight: 700; color: #000; flex-shrink: 0; }
.account-form input {
  flex: 1; height: 32px; padding: 0 15px; border: 1px solid #dcdcdc; border-radius: 16px;
  font-size: 12px; color: #5e5e5e; outline: none; background: #fff;
}

.card-security { flex: 1; text-align: center; position: relative; display: flex; flex-direction: column; justify-content: space-between; }
.card-security img.shield { height: 80px; margin: 0 auto 15px; }
.security-controls { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; padding: 0 10px; }
.security-controls img.toggle { width: 50px; cursor: pointer; }
.security-controls img.logout { width: 60px; cursor: pointer; }
.security-text { font-size: 9px; color: #929292; text-align: left; line-height: 1.4; }
.security-text a { color: #929292; text-decoration: underline; }

/* Main Area (Tabs + Content) */
.dash-main { display: flex; gap: 20px; }
.dash-sidebar { width: 200px; display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; }
.dash-sidebar button { background: none; border: none; padding: 0; cursor: pointer; width: 100%; text-align: left; }
.dash-sidebar button img { width: 100%; height: auto; display: block; transition: transform 0.2s; }
.dash-sidebar button:hover img { transform: scale(1.02); }

.dash-content {
  flex: 1; background: #fff; border-radius: 12px; padding: 30px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05); border: 1px solid #eaeaea;
  min-height: 500px; position: relative; display: flex; flex-direction: column;
}

/* Tab Logic */
.tab-pane { display: none; flex: 1; flex-direction: column; }
.tab-pane.active { display: flex; }
.list-container { flex: 1; overflow-y: auto; margin-bottom: 50px; }

/* --- My Download Layout --- */
.download-item { display: flex; align-items: center; padding: 15px 0; border-bottom: 1px solid #eaeaea; }
.download-item input[type="checkbox"] { margin-right: 15px; width: 16px; height: 16px; cursor: pointer; }
.download-name { flex: 1; font-size: 12px; color: #5e5e5e; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.download-sep { margin: 0 15px; color: #000; font-weight: 300; }
.download-size { width: 60px; font-size: 12px; color: #5e5e5e; text-align: center; }
.download-action { margin-left: 15px; font-size: 12px; color: #007bff; font-weight: 700; cursor: pointer; text-decoration: none; }

/* --- My Purchase Layout --- */
.purchase-item { margin-bottom: 30px; }
.purchase-row { display: flex; gap: 20px; margin-bottom: 12px; }
.purchase-col { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.purchase-col label { width: 90px; font-size: 11px; font-weight: 700; color: #000; flex-shrink: 0; }
.purchase-col input {
  flex: 1; height: 32px; padding: 0 15px; border: 1px solid #dcdcdc; border-radius: 16px;
  font-size: 12px; color: #5e5e5e; background: #fff; outline: none; min-width: 0;
}
.purchase-col textarea {
  flex: 1; padding: 12px 15px; border: 1px solid #dcdcdc; border-radius: 12px;
  font-size: 12px; color: #5e5e5e; background: #fff; resize: none; min-height: 70px; font-family: var(--font-base); outline: none;
}
.purchase-separator { border-bottom: 3px double #dcdcdc; margin: 25px 0 0 0; }

/* --- My Inbox Layout --- */
.inbox-item {
  border: 1px solid #dcdcdc; border-radius: 12px; padding: 15px 20px;
  margin-bottom: 15px; min-height: 60px; font-size: 12px; color: #5e5e5e; background: #fff;
}

/* Bottom Controls */
.dash-bottom-controls {
  position: absolute; bottom: 30px; left: 30px; right: 30px;
  display: flex; justify-content: space-between; align-items: center;
}
.dash-delete { font-size: 12px; font-weight: 700; color: #000; cursor: pointer; }
.dash-pagination { display: flex; gap: 20px; font-size: 12px; font-weight: 700; color: #000; }
.dash-pagination span { cursor: pointer; }

/* Footer Banner */
.dash-footer-banner { margin-top: 20px; position: relative; }
.dash-footer-banner img { width: 100%; border-radius: 8px; display: block; }
.dash-footer-text { position: absolute; bottom: 20px; left: 20px; color: #929292; font-family: var(--font-mono); font-size: 10px; }
.dash-copyright { text-align: center; margin-top: 15px; font-size: 11px; font-weight: 700; color: #000; }
