/* ========================================
   Rimba Raya Group — Employee Form Styles
   Mobile-first base stylesheet
   Black (#0A0A0A) + Gold (#C9A227) palette
   ======================================== */

:root {
  --primary: #0A0A0A;
  --primary-dark: #000000;
  --primary-light: #1F1F1F;
  --accent: #C9A227;
  --accent-light: #E8C766;
  --bg: #F8F8F5;
  --bg-pattern: #F0EFEA;
  --surface: #FFFFFF;
  --text: #1A1A1A;
  --text-muted: #6B6B6B;
  --border: #E6E4DF;
  --border-focus: #C9A227;
  --shadow: 0 14px 48px rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.05);
  --radius: 18px;
  --radius-sm: 14px;
  --radius-xs: 10px;
  --font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --success: #C9A227;
  --error: #B91C1C;
  --error-bg: #FEF2F2;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: linear-gradient(180deg, var(--bg) 0%, #FFFFFF 100%);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

.container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.brand-header {
  background: var(--primary);
  border-bottom: 1px solid rgba(201, 162, 39, 0.28);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.header-inner {
  display: flex;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  height: 52px;
  width: auto;
  display: block;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent-light);
}

.brand-tagline {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 500;
  letter-spacing: 0.2px;
}

/* Main content */
.main-content {
  flex: 1;
  padding-top: 24px;
  padding-bottom: 40px;
}

.form-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 18px;
  overflow: hidden;
  border-top: 4px solid var(--accent);
}

.form-header {
  text-align: center;
  margin-bottom: 24px;
}

.form-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 8px;
}

.lead {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* Progress */
.progress {
  margin-bottom: 24px;
}

.progress-track {
  height: 6px;
  background: #E5E7EB;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 14px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 10px;
  transition: width 0.4s ease;
}

.steps {
  display: flex;
  justify-content: space-between;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 4px;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  text-align: center;
  position: relative;
}

.step-number {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  background: #F3F4F6;
  color: var(--text-muted);
  border: 2px solid transparent;
  transition: all 0.25s ease;
}

.step-label {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.25s ease;
  line-height: 1.2;
}

.step.active .step-number {
  background: var(--accent);
  color: #000;
  box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.22);
}

.step.active .step-label {
  color: var(--accent);
  font-weight: 600;
}

.step.completed .step-number {
  background: var(--primary);
  color: var(--accent-light);
}

.step.completed .step-label {
  color: var(--primary);
}

/* Form sections */
fieldset {
  border: none;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.step-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.step-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.section-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-xs);
  background: rgba(201, 162, 39, 0.12);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 1rem;
}

.section-title h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.section-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: -8px 0 22px;
}

/* Form rows & groups */
.form-row {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 20px;
}

.form-row.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}

.form-group.full {
  width: 100%;
}

label,
.form-label-block {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.form-label-block {
  display: block;
  margin-bottom: 4px;
}

.required {
  color: var(--error);
}

.optional {
  color: var(--text-muted);
  font-size: 0.8em;
  font-weight: 500;
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 14px 14px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 52px;
}

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

select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2248%22%20height%3D%2224%22%20viewBox%3D%220%200%2048%2024%22%3E%3Cline%20x1%3D%2214%22%20y1%3D%225%22%20x2%3D%2214%22%20y2%3D%2219%22%20stroke%3D%22%23E6E4DF%22%20stroke-width%3D%222%22%2F%3E%3Cpolyline%20points%3D%2228%2C9%2034%2C16%2040%2C9%22%20fill%3D%22none%22%20stroke%3D%22%230A0A0A%22%20stroke-width%3D%222.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: auto 55%;
  padding-right: 56px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.16);
}

input.invalid,
select.invalid,
textarea.invalid {
  border-color: var(--error);
  background: var(--error-bg);
}

input.invalid:focus,
select.invalid:focus,
textarea.invalid:focus {
  box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.12);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: #F3F2EF;
  color: var(--text-muted);
  cursor: not-allowed;
  border-color: var(--border);
  opacity: 0.85;
}

.error-msg {
  color: var(--error);
  font-size: 0.8rem;
  font-weight: 500;
  min-height: 1em;
}

/* Checkboxes */
.checkbox,
.checkbox-card {
  display: inline-flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text);
  position: relative;
}

.checkbox input,
.checkbox-card input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkmark {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  position: relative;
  transition: all 0.2s ease;
  margin-top: 1px;
}

.checkbox input:checked + .checkmark,
.checkbox-card input:checked + .checkmark {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox input:checked + .checkmark::after,
.checkbox-card input:checked + .checkmark::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-text {
  line-height: 1.45;
}

.confirm-checkbox {
  background: rgba(201, 162, 39, 0.06);
  padding: 16px;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(201, 162, 39, 0.2);
}

.confirm-checkbox .checkbox-text {
  font-size: 0.92rem;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.checkbox-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 16px;
  background: var(--surface);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  align-items: center;
}

.checkbox-card:hover {
  border-color: var(--accent);
}

.checkbox-card input:checked ~ .cc-text strong,
.checkbox-card input:checked ~ .cc-text small {
  color: var(--primary);
}

.checkbox-card input:checked + .checkmark + .cc-text strong {
  color: var(--primary);
}

.cc-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.cc-text strong {
  font-size: 0.95rem;
  color: var(--text);
}

.cc-text small {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* File dropzone */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-xs);
  padding: 28px 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  background: #FAFAFA;
}

.dropzone:hover {
  border-color: var(--accent);
  background: rgba(201, 162, 39, 0.04);
}

.dropzone.has-file {
  border-color: var(--accent);
  background: rgba(201, 162, 39, 0.07);
}

.dropzone input {
  display: none;
}

.dz-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(201, 162, 39, 0.12);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 1.25rem;
}

.dz-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.dz-hint {
  font-size: 0.84rem;
  color: var(--text-muted);
  word-break: break-word;
}

/* Buttons */
.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  min-height: 52px;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #000;
  box-shadow: 0 4px 14px rgba(201, 162, 39, 0.35);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--accent-light), #F5DE8A);
  box-shadow: 0 6px 18px rgba(201, 162, 39, 0.45);
}

.btn-secondary {
  background: #F3F2EF;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: #E8E6E1;
}

.btn-success {
  background: var(--primary);
  color: var(--accent-light);
  border: 1.5px solid var(--accent);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.btn-success:hover:not(:disabled) {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

/* Summary */
.summary {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.summary-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  background: #FAFAFA;
}

.summary-card h3 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
}

.summary-card dl {
  margin: 0;
  display: grid;
  gap: 10px;
}

.summary-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.summary-row dt {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.summary-row dd {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 500;
  margin: 0;
  word-break: break-word;
}

/* Success state */
.success-state {
  text-align: center;
  padding: 36px 16px;
  animation: fadeIn 0.4s ease;
}

.success-icon {
  font-size: 4.5rem;
  color: var(--success);
  margin-bottom: 16px;
}

.success-state h2 {
  font-size: 1.5rem;
  color: var(--accent);
  margin: 0 0 10px;
}

.success-state p {
  color: var(--text-muted);
  max-width: 460px;
  margin: 0 auto 26px;
}

.success-actions {
  display: flex;
  justify-content: center;
}

/* Footer */
.site-footer {
  background: var(--primary);
  color: rgba(255, 255, 255, 0.85);
  padding: 24px 0;
  margin-top: auto;
}

.footer-inner {
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 0.85rem;
}

.footer-domain {
  margin-top: 4px !important;
  font-weight: 600;
  color: var(--accent-light);
  letter-spacing: 0.5px;
}

/* Draft status */
.draft-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 14px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: rgba(201, 162, 39, 0.08);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 500;
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: var(--primary);
  color: #fff;
  padding: 14px 18px;
  border-radius: var(--radius-xs);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 100;
  border-left: 4px solid var(--accent);
  max-width: calc(100% - 32px);
  width: max-content;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(20px);
}

.toast i {
  color: var(--accent);
  font-size: 1.1rem;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
