/* ============================================================
   customer-dashboard.css  |  True Cargo — Customer Portal
   ============================================================ */

/* ── Variables ── */
:root {
  --brand-yellow : #f2b300;
  --brand-dark   : #1a1a2e;
  --brand-navy   : #16213e;
  --accent       : #fecc00;
  --white        : #ffffff;
  --bg-light     : #f7f8fc;
  --border       : #e8eaf0;
  --text-main    : #1a1a2e;
  --text-muted   : #6b7280;
  --text-sub     : #9ca3af;
  --radius-md    : 12px;
  --radius-lg    : 18px;
  --shadow-sm    : 0 2px 8px rgba(0,0,0,.07);
  --shadow-md    : 0 6px 24px rgba(0,0,0,.10);
  --shadow-lg    : 0 16px 48px rgba(0,0,0,.13);
  --transition   : all .22s ease;
}

/* ── Reset helpers ── */
*, *::before, *::after { box-sizing: border-box; }

/* ════════════════════════════════════════
   SUB-NAVBAR
════════════════════════════════════════ */
.sub-navbar {
  background: var(--white);
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 900;
}

.sub-navbar__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
}

.sub-navbar__links {
  display: flex;
  gap: 4px;
}

.sub-navbar__link {
  padding: 8px 20px;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: .3px;
}

.sub-navbar__link:hover {
  color: var(--text-main);
  background: var(--bg-light);
}

.sub-navbar__link.active {
  background: var(--brand-yellow);
  color: var(--brand-dark);
}

.sub-navbar__welcome {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}

.sub-navbar__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand-yellow);
  color: var(--brand-dark);
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ════════════════════════════════════════
   LOGIN SECTION
════════════════════════════════════════ */
.login-section {
  min-height: calc(100vh - 180px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}

.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 440px;
  overflow: hidden;
}

.login-card-header {
  background: var(--white);
  border-bottom: 1.5px solid var(--border);
  padding: 36px 36px 28px;
  text-align: center;
  color: var(--text-main);
}

.login-badge {
  display: inline-block;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #b45309;
  border-radius: 20px;
  padding: 5px 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.login-card-header h2 {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--text-main);
}

.login-card-header p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

.login-card-body {
  padding: 32px 36px 36px;
}

/* ── Fields ── */
.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
  letter-spacing: .3px;
  text-transform: uppercase;
}

.field .di {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: inherit;
  color: var(--text-main);
  background: #fafbfd;
  transition: var(--transition);
  outline: none;
}

.field .di:focus {
  border-color: var(--brand-yellow);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(242,179,0,.12);
}

.field-inner {
  position: relative;
}

/* Phone prefix */
.phone-input-wrap {
  display: flex;
  align-items: center;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: #fafbfd;
  overflow: hidden;
  transition: var(--transition);
}

.phone-input-wrap:focus-within {
  border-color: var(--brand-yellow);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(242,179,0,.12);
}

.phone-prefix {
  padding: 13px 14px 13px 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-muted);
  background: #f0f2f8;
  border-right: 2px solid var(--border);
  white-space: nowrap;
  user-select: none;
}

.phone-input-wrap .di {
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  flex: 1;
}

/* Error messages */
.field-error,
.otp-wrong-error {
  display: none;
  margin-top: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: #e53e3e;
}

/* ── OTP Sent message ── */
.otp-sent-msg {
  background: #f0fff4;
  border: 1px solid #9ae6b4;
  color: #276749;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ── OTP Boxes ── */
.otp-boxes {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 4px;
}

.otp-input {
  width: 50px;
  height: 56px;
  border: 2px solid var(--border);
  border-radius: 10px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--brand-dark);
  background: #fafbfd;
  transition: var(--transition);
  outline: none;
  font-family: inherit;
}

.otp-input:focus {
  border-color: var(--brand-yellow);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(242,179,0,.12);
}

.otp-input.filled {
  border-color: var(--brand-yellow);
  background: #fffbeb;
  color: var(--brand-dark);
}

/* ── Login Button ── */
.btn-login {
  width: 100%;
  padding: 15px 24px;
  background: linear-gradient(135deg, var(--brand-yellow) 0%, #e6a800 100%);
  color: var(--brand-dark);
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 800;
  font-family: inherit;
  letter-spacing: .4px;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 4px;
  box-shadow: 0 4px 14px rgba(242,179,0,.35);
}

.btn-login:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(242,179,0,.45);
}

.btn-login:active:not(:disabled) {
  transform: translateY(0);
}

.btn-login:disabled {
  opacity: .65;
  cursor: not-allowed;
}

/* ── Footer note ── */
.login-footer-note {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 18px;
}

.login-footer-note a {
  color: var(--brand-yellow);
  font-weight: 600;
  text-decoration: none;
}

.login-footer-note a:hover {
  text-decoration: underline;
}

/* ════════════════════════════════════════
   DASHBOARD WRAPPER
════════════════════════════════════════ */
.page-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

/* ── Tab visibility ── */
.tab-content          { display: none; }
.tab-content.active   { display: block; }

/* ════════════════════════════════════════
   PROFILE TAB
════════════════════════════════════════ */
.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, var(--brand-dark) 0%, #0f3460 100%);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 28px;
  color: var(--white);
}

.profile-avatar-lg {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--brand-yellow);
  color: var(--brand-dark);
  font-size: 30px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(242,179,0,.4);
}

.profile-header-info h3 {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--white);
}

.role-badge {
  display: inline-block;
  background: rgba(242,179,0,.18);
  border: 1px solid rgba(242,179,0,.45);
  color: var(--brand-yellow);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
}

/* Profile grid */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.profile-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  transition: var(--transition);
}

.profile-card:hover {
  border-color: var(--brand-yellow);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.profile-card-icon {
  font-size: 22px;
  margin-bottom: 10px;
}

.profile-card-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-sub);
  margin-bottom: 5px;
}

.profile-card-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.profile-card-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Status row */
.profile-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f0fff4;
  border: 1.5px solid #9ae6b4;
  border-radius: var(--radius-md);
  padding: 14px 20px;
}

.status-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #38a169;
  box-shadow: 0 0 0 3px rgba(56,161,105,.25);
  flex-shrink: 0;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(56,161,105,.25); }
  50%       { box-shadow: 0 0 0 6px rgba(56,161,105,.10); }
}

.status-text {
  font-size: 14px;
  font-weight: 700;
  color: #276749;
}

.status-sub {
  font-size: 13px;
  color: #48bb78;
  margin-left: auto;
}

/* ════════════════════════════════════════
   TASK / BOOKING TAB
════════════════════════════════════════ */
.section-wrap {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.tasks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1.5px solid var(--border);
  background: var(--bg-light);
}

.tasks-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.tasks-count {
  background: var(--brand-yellow);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
}

/* Task list */
.task-list {
  padding: 8px 0;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 24px;
  border-bottom: 1px solid #f1f3f8;
  transition: var(--transition);
}

.task-item:last-child { border-bottom: none; }

.task-item:hover {
  background: #fafbfd;
}

.task-icon {
  font-size: 22px;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #f0f2f8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.task-body {
  flex: 1;
  min-width: 0;
}

.task-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-meta {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Badges */
.task-badge {
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 13px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: .3px;
}

.badge-progress {
  background: #ebf8ff;
  color: #2b6cb0;
  border: 1px solid #bee3f8;
}

.badge-urgent {
  background: #fff5f5;
  color: #c53030;
  border: 1px solid #fed7d7;
}

.badge-pending {
  background: #fffff0;
  color: #b7791f;
  border: 1px solid #faf089;
}

.badge-done {
  background: #f0fff4;
  color: #276749;
  border: 1px solid #9ae6b4;
}

/* ════════════════════════════════════════
   SIGN UP MODAL
════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.modal-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  animation: modalIn .2s ease;
  margin: auto;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal-card-header {
  background: linear-gradient(135deg, var(--brand-dark) 0%, #0f3460 100%);
  padding: 28px 32px 22px;
  text-align: center;
  color: var(--white);
  position: relative;
}

.modal-card-header h2 {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 4px;
  color: var(--white);
}

.modal-card-header p {
  font-size: 13px;
  color: #94a3b8;
  margin: 0;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: rgba(255,255,255,.12);
  border: none;
  color: var(--white);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  background: rgba(255,255,255,.25);
}

.modal-card-body {
  padding: 24px 32px 32px;
  max-height: 70vh;
  overflow-y: auto;
}

/* ── First + Last name side-by-side ── */
.signup-name-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── Password show/hide toggle ── */
.password-wrap {
  display: flex;
  align-items: center;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: #fafbfd;
  overflow: hidden;
  transition: var(--transition);
}

.password-wrap:focus-within {
  border-color: var(--brand-yellow);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(242,179,0,.12);
}

.password-wrap .di {
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  flex: 1;
}

.toggle-pw {
  background: none;
  border: none;
  padding: 0 14px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: color .18s ease;
  flex-shrink: 0;
}

.toggle-pw:hover {
  color: var(--brand-yellow);
}

/* ── Signup API error banner ── */
.signup-api-error {
  background: #fff5f5;
  border: 1px solid #fed7d7;
  color: #c53030;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
  line-height: 1.5;
}

/* ════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════ */
@media (max-width: 600px) {
  .login-card-body   { padding: 24px 20px 28px; }
  .login-card-header { padding: 28px 20px 22px; }
  .otp-input         { width: 42px; height: 50px; font-size: 20px; }
  .otp-boxes         { gap: 7px; }

  .profile-header    { flex-direction: column; text-align: center; padding: 22px 20px; }
  .profile-grid      { grid-template-columns: 1fr 1fr; }
  .profile-status-row{ flex-wrap: wrap; }
  .status-sub        { margin-left: 0; width: 100%; }

  .task-item         { padding: 14px 16px; }
  .task-name         { white-space: normal; }
  .page-wrap         { padding: 24px 16px 48px; }

  .sub-navbar__welcome span { display: none; }

  .modal-card-header { padding: 22px 20px 16px; }
  .modal-card-body   { padding: 18px 20px 24px; max-height: 75vh; }
  .signup-name-row   { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 400px) {
  .profile-grid { grid-template-columns: 1fr; }
  .otp-input    { width: 38px; height: 46px; font-size: 18px; }
}