@charset "UTF-8";

/* ==========================================================================
   eCargo Portal — Enterprise Theme
   Mahan World Cargo | Global Logistics Platform
   ==========================================================================
   Layouts (detected via :has()):
     • Login page         .content:has(#login-box)      → split-screen
     • Home/utility page  default                       → top bar + content
       - home             .island > .tiles
       - change_password  .island > .island-content > form
       - change_email     .island > .island-content > form
   ========================================================================== */

/* ---------- Design Tokens ---------- */
:root {
  --brand-deep:      #0b3622;
  --brand-primary:   #145434;
  --brand-mid:       #1f7246;
  --brand-light:     #2f9a5e;
  --brand-accent:    #c8a24a;
  --brand-accent-2:  #e6c57a;

  --surface:         #ffffff;
  --surface-soft:    #f7f9f7;
  --surface-line:    #e5eae6;

  --ink:             #0e1a13;
  --ink-soft:        #334039;
  --ink-muted:       #6b7870;
  --ink-faint:       #9aa49e;

  --danger:          #b84033;
  --danger-soft:     #fdecea;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --shadow-card:  0 1px 2px rgba(14,26,19,.04), 0 8px 30px rgba(14,26,19,.06);
  --shadow-lift:  0 4px 12px rgba(14,26,19,.08), 0 20px 50px rgba(14,26,19,.10);

  --font-display: "Manrope", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-body:    -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.bg-black { background: var(--surface-soft); }

img { max-width: 100%; display: block; }
a  { color: var(--brand-mid); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--brand-primary); }

::selection { background: rgba(31, 114, 70, .18); color: var(--brand-deep); }

/* ==========================================================================
   DEFAULT LAYOUT — Top bar + content
   ========================================================================== */

.content {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top bar */
.content > .header {
  position: relative;
  flex: 0 0 auto;
  height: 72px;
  padding: 0 32px;
  background-color: var(--brand-deep) !important;
  background-repeat: no-repeat !important;
  background-position: 28px center !important;
  background-size: auto 44px !important;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 2px 10px rgba(11, 54, 34, .18);
  overflow: visible;
}

.content > .header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(90deg, transparent 0%, rgba(47,154,94,.12) 40%, transparent 100%),
    repeating-linear-gradient(135deg, transparent 0 22px, rgba(255,255,255,.02) 22px 23px);
  pointer-events: none;
}

.content > .header::after {
  content: "eCargo";
  position: absolute;
  left: 96px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: #ffffff;
  padding-left: 16px;
  border-left: 1px solid rgba(255,255,255,.18);
  z-index: 1;
}

/* ========== Nav / User dropdown ========== */

.content > .header .nav {
  position: relative;
  z-index: 3;
  margin-left: auto;
  display: flex;
  align-items: center;
  /* Add padding-bottom so hover area extends below the trigger, creating a bridge */
}

.content > .header .dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease;
  user-select: none;
}
.content > .header .dropdown-trigger:hover {
  background: rgba(255,255,255,.14);
}
.content > .header .dropdown-trigger .fa-chevron-down {
  font-size: 11px;
  opacity: .7;
}

/* Dropdown menu with INVISIBLE hover bridge
   padding-top on the container creates a transparent buffer so the mouse
   can travel from the trigger to the menu without losing :hover. */
.content > .header .dropdown-content {
  position: absolute;
  top: 100%;          /* no gap from trigger */
  right: 0;
  min-width: 220px;
  margin: 0;
  padding: 14px 0 0 0; /* 14px transparent bridge */
  list-style: none;
  background: transparent;
  border: 0;
  box-shadow: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
  pointer-events: none;
}

/* The visible "card" of the dropdown is drawn via ::before so it doesn't
   include the transparent bridge area. */
.content > .header .dropdown-content::before {
  content: "";
  position: absolute;
  top: 14px; right: 0; bottom: 0; left: 0;
  background: #ffffff;
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lift);
  z-index: -1;
}

.content > .header .nav:hover .dropdown-content,
.content > .header .nav:focus-within .dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.content > .header .dropdown-content li {
  list-style: none;
  margin: 0;
  padding: 0 6px;
}
.content > .header .dropdown-content li:first-child { padding-top: 6px; }
.content > .header .dropdown-content li:last-child  { padding-bottom: 6px; }

.content > .header .dropdown-content li a {
  display: block;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--ink-soft);
  transition: background .12s ease, color .12s ease;
}
.content > .header .dropdown-content li a:hover {
  background: var(--surface-soft);
  color: var(--brand-primary);
}

/* ========== Main island (used by home, change_password, change_email) ========== */

.island {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 32px 64px;
}

.island > h1 {
  margin: 0 0 28px;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.02em;
  line-height: 1.2;
}

/* ---- Home: tile grid ---- */
.island .tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.island .tiles > li { list-style: none; }

.island .tiles > li > a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 22px;
  min-height: 88px;
  background: var(--surface);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  transition: transform .15s ease, box-shadow .2s ease, border-color .15s ease;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.island .tiles > li > a::before {
  content: "";
  width: 6px;
  height: 44px;
  background: linear-gradient(180deg, var(--brand-mid), var(--brand-light));
  border-radius: 3px;
  flex-shrink: 0;
}

.island .tiles > li > a::after {
  content: "↗";
  margin-left: auto;
  font-size: 18px;
  color: var(--ink-faint);
  transition: transform .2s ease, color .15s ease;
}

.island .tiles > li > a:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  border-color: var(--brand-light);
  color: var(--brand-primary);
}
.island .tiles > li > a:hover::after {
  color: var(--brand-mid);
  transform: translate(2px, -2px);
}

/* ---- Change password / Change email: centered form card ---- */
.island > .island-content {
  max-width: 480px;
  margin: 8px auto 0;
  padding: 32px 32px 28px;
  background: var(--surface);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.island > .island-content > .email-display {
  margin: 0 0 18px;
  padding: 12px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
}

.island > .island-content form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Inputs inside island-content (no label) */
.island > .island-content .form-control {
  margin: 0;
}

/* Submit button unique to these pages (input[type=submit].island-button) */
.island-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin-top: 8px;
  padding: 12px 18px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1;
  color: #ffffff;
  background: var(--brand-primary);
  border: 1px solid var(--brand-primary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform .1s ease, background .15s ease, box-shadow .15s ease;
  box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 4px 14px rgba(20, 84, 52, .18);
  -webkit-appearance: none;
          appearance: none;
  width: 100%;
}
.island-button:hover, .island-button:focus {
  background: #0f4028;
  border-color: #0f4028;
  outline: 0;
  box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 6px 20px rgba(20, 84, 52, .26);
}
.island-button:active { transform: translateY(1px); }

/* Hide preload div */
.image-preload { display: none !important; }

/* ==========================================================================
   Profile / Account Settings page
   Structure: .panel-container > .panel > h1 + .panel-content
   ========================================================================== */

.panel-container {
  flex: 1 1 auto;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 32px 64px;
}

.panel > h1 {
  margin: 0 0 24px;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.02em;
  line-height: 1.2;
}

.panel-content {
  background: var(--surface);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 28px 32px;
}

.panel-content > h2 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--surface-line);
  letter-spacing: -.005em;
}

.panel-content > h2 + p,
.panel-content > h2 + .profile { margin-top: 0; }

.panel-content > h2:not(:first-child) {
  margin-top: 32px;
}

.panel-content > p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
}

/* .profile paragraph: laid out as a 2-col grid
   spans = value chips on left, anchors = action buttons on right */
.panel-content > p.profile {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 20px;
  align-items: center;
}

.panel-content > p.profile > span {
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 13.5px;
  color: var(--ink);
  padding: 10px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-md);
  letter-spacing: .01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-content > p.profile > a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-mid);
  padding: 9px 14px;
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-md);
  transition: border-color .15s ease, color .15s ease, background .15s ease;
  white-space: nowrap;
}

.panel-content > p.profile > a:hover {
  border-color: var(--brand-mid);
  background: rgba(31, 114, 70, .06);
  color: var(--brand-primary);
  text-decoration: none;
}

/* Footer spacer */
.content > .footer-spacer {
  flex: 0 0 auto;
  padding: 24px 32px 20px;
  text-align: center;
  font-size: 11.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-top: 1px solid var(--surface-line);
  background: var(--surface);
}
.content > .footer-spacer::before {
  content: "Mahan World Cargo  •  جهان ترابر ماهان";
  display: block;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 4px;
  letter-spacing: .1em;
}
.content > .footer-spacer::after {
  content: "Powered by Parvan Pajooh  •  توسعه یافته توسط پروان پژوه";
  display: block;
  font-size: 10.5px;
  font-weight: 400;
  color: var(--ink-faint);
  letter-spacing: .08em;
  text-transform: none;
}

/* ==========================================================================
   LOGIN LAYOUT — split screen, NO logo
   ========================================================================== */

.content:has(#login-box) {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  min-height: 100vh;
}

/* LEFT PANEL — brand backdrop (NO logo image) */
.content:has(#login-box) > .header {
  height: auto;
  padding: 56px 48px 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  background-color: var(--brand-deep) !important;
  background-image: none !important;      /* <-- no logo on login */
  box-shadow: none;
  overflow: hidden;
}

.content:has(#login-box) > .header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1200px 600px at 15% 10%, rgba(47, 154, 94, .35), transparent 60%),
    radial-gradient(900px 500px at 95% 95%, rgba(200, 162, 74, .18), transparent 55%),
    linear-gradient(135deg, var(--brand-deep) 0%, var(--brand-primary) 55%, #0e4027 100%);
}

.content:has(#login-box) > .header::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    repeating-linear-gradient(
      135deg,
      transparent 0 22px,
      rgba(255, 255, 255, .025) 22px 23px
    );
  pointer-events: none;
  border: 0;
  left: auto;
  top: auto;
  transform: none;
  font-size: 0;
}

/* Brand wordmark top-left of login page (only) */
body.bg-black:has(#login-box)::before {
  content: "eCargo";
  position: fixed;
  top: 36px;
  left: 48px;
  z-index: 5;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: #ffffff;
  padding-left: 18px;
  background: radial-gradient(circle at 4px center, var(--brand-accent) 4px, transparent 4.5px) no-repeat left center;
  pointer-events: none;
}

/* Tagline centered on left panel */
body.bg-black:has(#login-box)::after {
  content: "ENTERPRISE LOGISTICS PLATFORM";
  position: fixed;
  top: 50%;
  left: 0;
  width: 55.5%;
  transform: translateY(-50%);
  text-align: center;
  z-index: 5;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 22px;
  letter-spacing: .2em;
  color: rgba(255, 255, 255, .86);
  pointer-events: none;
}

/* Bottom signature on login only */
.content:has(#login-box) > .footer-spacer {
  position: fixed;
  bottom: 28px;
  left: 48px;
  width: auto;
  padding: 0;
  border-top: 0;
  background: transparent;
  text-align: left;
  font-size: 12px;
  color: rgba(255, 255, 255, .55);
  letter-spacing: .08em;
  text-transform: uppercase;
  z-index: 5;
}
.content:has(#login-box) > .footer-spacer::before {
  content: "Mahan World Cargo  •  جهان ترابر ماهان";
  display: block;
  color: rgba(255, 255, 255, .72);
  font-weight: 600;
  margin-bottom: 3px;
  letter-spacing: .1em;
}
.content:has(#login-box) > .footer-spacer::after {
  content: "Powered by Parvan Pajooh";
  display: block;
  font-size: 10.5px;
  color: rgba(255, 255, 255, .4);
  letter-spacing: .08em;
  text-transform: none;
}

/* RIGHT PANEL — form */
.content:has(#login-box) > .form-box {
  grid-column: 2;
  align-self: center;
  justify-self: center;
  width: 100%;
  max-width: 440px;
  padding: 48px 56px;
  background: var(--surface);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  margin: 48px 40px;
  animation: ecargo-fade-in .5s ease both;
}

/* Form title */
#login-box > .header {
  position: static;
  padding: 0 0 8px;
  height: auto;
  background: none !important;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.015em;
  line-height: 1.2;
  text-align: left;
  box-shadow: none;
  display: block;
  overflow: visible;
}

#login-box > .header::before,
#login-box > .header::after {
  all: unset;
}

#login-box > .header::after {
  content: "Sign in to access your dashboard";
  display: block;
  margin-top: 10px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  color: var(--ink-muted);
  letter-spacing: 0;
  text-transform: none;
  position: static;
}

#login-box form { margin-top: 28px; }

/* ==========================================================================
   Shared form components
   ========================================================================== */

.body.bg-gray {
  background: transparent !important;
  padding: 0 !important;
  border: 0 !important;
}

.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: .01em;
}

.form-control {
  display: block;
  width: 100%;
  height: 46px;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-md);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  box-shadow: none;
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
}
.form-control:hover   { border-color: #cfd8d2; }
.form-control:focus   {
  outline: 0;
  background: #ffffff;
  border-color: var(--brand-mid);
  box-shadow: 0 0 0 4px rgba(31, 114, 70, .12);
}
.form-control::placeholder { color: var(--ink-faint); font-size: 14px; }

/* Generic .btn (used in login) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 12px 18px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1;
  color: #ffffff;
  text-align: center;
  text-decoration: none;
  background: var(--brand-primary);
  border: 1px solid var(--brand-primary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform .1s ease, background .15s ease, box-shadow .15s ease;
  box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 4px 14px rgba(20, 84, 52, .18);
}
.btn:hover, .btn:focus {
  background: #0f4028;
  border-color: #0f4028;
  color: #ffffff;
  box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 6px 20px rgba(20, 84, 52, .26);
  outline: 0;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }

.btn-block { display: flex; width: 100%; }

.bg-olive { background: var(--brand-primary) !important; color: #ffffff !important; }

/* Alerts */
.alert {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.45;
}
.alert-error, .alert-danger {
  color: #7a2820;
  background: var(--danger-soft);
  border-color: #f3c8c2;
}
.alert p { margin: 0; }

#login-box h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
  margin: 0;
  line-height: 1.4;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 960px) {
  .content:has(#login-box) {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .content:has(#login-box) > .header {
    min-height: 180px;
    padding: 32px 24px;
  }
  .content:has(#login-box) > .form-box {
    grid-column: 1;
    margin: 24px 16px 40px;
    padding: 32px 28px;
  }
  body.bg-black:has(#login-box)::before {
    top: 20px; left: 24px; font-size: 20px;
  }
  body.bg-black:has(#login-box)::after { display: none; }
  .content:has(#login-box) > .footer-spacer { display: none; }

  .content > .header {
    padding: 0 16px;
    height: 64px;
    background-position: 16px center !important;
    background-size: auto 36px !important;
  }
  .content > .header::after { left: 72px; font-size: 17px; }
  .island { padding: 28px 20px 48px; }
  .island > h1 { font-size: 24px; }
}

@media (max-width: 480px) {
  .content:has(#login-box) > .form-box {
    padding: 28px 22px;
    border-radius: var(--radius-md);
  }
  #login-box > .header { font-size: 22px; }
  .island > .island-content { padding: 24px 20px; }
}

/* Animations */
@keyframes ecargo-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

a:focus-visible, button:focus-visible, .island-button:focus-visible {
  outline: 2px solid var(--brand-mid);
  outline-offset: 2px;
}
