/* =====================================================
   Rolling Translations Portal — Design System v2
   ===================================================== */

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

/* ---- CSS Variables ---- */
:root {
  /* Brand */
  --navy:         #1B3A5C;
  --navy-dark:    #122840;
  --navy-mid:     #2563EB;
  --navy-light:   #EBF2FB;
  --navy-xlight:  #F4F8FD;

  /* Text */
  --text-primary:   #111827;
  --text-secondary: #4B5563;
  --text-muted:     #9CA3AF;

  /* Borders */
  --border:       #E2E8F0;
  --border-focus: #2563EB;

  /* Semantic */
  --success:     #0D7A5F;
  --success-bg:  #ECFDF5;
  --success-border: #A7F3D0;
  --error:       #B91C1C;
  --error-bg:    #FEF2F2;
  --error-border: #FECACA;
  --warning:     #B45309;
  --warning-bg:  #FFFBEB;
  --info:        #1D4ED8;
  --info-bg:     #EFF6FF;
  --info-border: #BFDBFE;

  /* Surface */
  --bg-page:  #EEF2F7;
  --bg-card:  #FFFFFF;

  /* Shapes */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(27,58,92,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 4px 20px rgba(27,58,92,.09), 0 1px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 40px rgba(27,58,92,.12), 0 2px 8px rgba(0,0,0,.05);

  /* Motion */
  --t: .17s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, Arial, sans-serif;
  background: var(--bg-page);
  margin: 0;
  padding: 0;
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Card container (auth / narrow pages) ---- */
.container {
  max-width: 480px;
  margin: 52px auto;
  background: var(--bg-card);
  padding: 44px 40px 36px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* ---- Logo ---- */
.logo {
  display: block;
  margin: 0 auto 28px;
  height: 58px;
  width: auto;
  object-fit: contain;
}

/* ---- Headings ---- */
h1 {
  text-align: center;
  color: var(--navy);
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -.3px;
}

.description,
.subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0 0 24px;
  line-height: 1.6;
}

/* ---- Labels ---- */
label {
  display: block;
  margin: 18px 0 5px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .01em;
}

/* ---- Inputs, Textareas, Selects ---- */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
textarea,
select {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text-primary);
  transition: border-color var(--t), box-shadow var(--t);
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 36px;
}

/* Multi-select overrides the chevron */
select[multiple] {
  background-image: none;
  padding-right: 13px;
  appearance: auto;
  -webkit-appearance: auto;
}

/* ---- Password peek ---- */
.password-field {
  position: relative;
}
.password-field input {
  padding-right: 48px;
}
.password-peek {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  height: 36px;
  width: auto;
  margin: 0;
  font-size: 16px;
  transition: color var(--t);
}
.password-peek:hover {
  background: transparent;
  color: var(--navy);
}

/* ---- Buttons (global defaults) ---- */
button {
  font-family: inherit;
  cursor: pointer;
  transition: background var(--t), border-color var(--t),
              color var(--t), box-shadow var(--t), transform var(--t);
}

/* Primary — navy fill */
button[type="submit"],
button.btn-primary {
  display: block;
  width: 100%;
  margin-top: 22px;
  padding: 12px 20px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .01em;
}
button[type="submit"]:hover,
button.btn-primary:hover {
  background: var(--navy-dark);
  box-shadow: 0 4px 12px rgba(27,58,92,.25);
}
button[type="submit"]:active,
button.btn-primary:active {
  transform: scale(.99);
}

/* Logout & ghost buttons */
#logoutBtn {
  display: block;
  margin: 20px auto 0;
  padding: 9px 28px;
  width: auto;
  background: #fff;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
}
#logoutBtn:hover {
  background: var(--navy-xlight);
  border-color: var(--navy);
  color: var(--navy);
}

/* ---- Links ---- */
a {
  color: var(--navy-mid);
  text-decoration: none;
  font-size: 14px;
}
a:hover {
  text-decoration: underline;
  color: var(--navy);
}

p {
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 20px;
}

/* ---- Instruction / hint text ---- */
.instruction,
.hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 3px 0 8px;
  line-height: 1.5;
}

/* ---- Language select box ---- */
.languages-box {
  height: 176px;
}

/* ---- Status / alert boxes ---- */
.status {
  border-radius: var(--radius-sm);
  display: none;
  font-size: 14px;
  margin: 14px 0;
  padding: 12px 16px;
  line-height: 1.5;
  border: 1px solid transparent;
}
.status.info    { background: var(--info-bg);    color: var(--info);    border-color: var(--info-border);    display: block; }
.status.error   { background: var(--error-bg);   color: var(--error);   border-color: var(--error-border);   display: block; }
.status.success { background: var(--success-bg); color: var(--success); border-color: var(--success-border); display: block; }

/* ---- Badges ---- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  background: var(--border);
  color: var(--text-secondary);
}
.badge.pending   { background: #FEF9EC; color: #92400E; border: 1px solid #FDE68A; }
.badge.progress  { background: var(--info-bg);    color: var(--info);    border: 1px solid var(--info-border); }
.badge.delivered { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.badge.rejected  { background: var(--error-bg);   color: var(--error);   border: 1px solid var(--error-border); }

/* ---- Deliverable download link (client dashboard) ---- */
.deliverable-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--navy);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  margin: 0 4px 4px 0;
  padding: 4px 12px;
  transition: background var(--t), border-color var(--t);
}
.deliverable-link:hover {
  background: var(--navy-light);
  border-color: var(--navy);
}

/* ---- Client dashboard table ---- */
#requestsTable {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin-top: 20px;
  font-size: 14px;
}
#requestsTable th,
#requestsTable td {
  border: 1px solid var(--border);
  padding: 11px 14px;
  text-align: left;
  word-wrap: break-word;
  vertical-align: top;
}
#requestsTable th {
  background: var(--navy-xlight);
  color: var(--navy);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  letter-spacing: .06em;
  text-transform: uppercase;
}
#requestsTable tbody tr:nth-child(even) {
  background: #FAFBFC;
}
#requestsTable tbody tr:hover {
  background: var(--navy-light);
}
#requestsTable tbody tr.rush {
  background: #FFF5F5 !important;
  border-left: 3px solid #FECACA;
}

/* ---- Rush flag ---- */
.rush-flag { color: var(--error); font-weight: 700; }

/* ---- Pending file items ---- */
.pending-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 4px 6px;
}
.pending-item .name {
  flex-grow: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pending-item .remove {
  font-size: 11px;
  line-height: 1;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid var(--error-border);
  cursor: pointer;
}

/* ---- Utility ---- */
.hidden { display: none !important; }
.small  { font-size: 12px; color: var(--text-muted); }
.muted  { color: var(--text-muted); margin: 16px 0; }
.left-aligned { text-align: left; }
.text-center  { text-align: center; }
