/* LW12 Assessment - Styles */
:root {
  --orange: #FF7400;
  --dark: #1C1C1C;
  --brown: #4A3728;
  --cream: #EFEBE5;
  --white: #FFFFFF;
  --gray-light: #F5F5F5;
  --gray: #999;
  --green: #2E7D32;
  --red: #C62828;
  --yellow: #F9A825;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--cream);
  color: var(--dark);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px;
}

.container.wide {
  max-width: 960px;
}

/* Brand */
.brand {
  margin-bottom: 24px;
}

.brand-logo {
  width: 120px;
  height: auto;
  display: block;
}

/* Cards */
.card {
  background: var(--white);
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.card.centered {
  text-align: center;
  margin-top: 60px;
}

.card.centered .brand {
  display: inline-block;
}

.card.centered h2 {
  margin-top: 16px;
}

/* Typography */
h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 12px;
}

h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--brown);
  margin-bottom: 8px;
}

p {
  margin-bottom: 12px;
  color: var(--dark);
}

.subtitle {
  color: var(--brown);
  font-size: 16px;
  margin-bottom: 24px;
}

.muted {
  color: var(--gray);
  font-size: 14px;
}

/* Success icon */
.success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--orange);
  color: var(--white);
  font-size: 32px;
  line-height: 64px;
  margin: 24px auto 16px;
}

/* Warning box */
.warning-box {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: #FFF3E0;
  border: 2px solid var(--orange);
  border-radius: 10px;
  padding: 20px 24px;
  margin-top: 12px;
}

.warning-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}

.warning-text p {
  margin-bottom: 8px;
  font-size: 15px;
  color: var(--dark);
}

.warning-text p:last-child {
  margin-bottom: 0;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--brown);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #E0DCD7;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.2s;
  background: var(--white);
}

.form-group input:focus {
  outline: none;
  border-color: var(--orange);
}

.form-group input.readonly {
  background: var(--gray-light);
  color: var(--gray);
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

.invite-form {
  max-width: 360px;
  margin: 0 auto;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.1s;
}

.btn:hover {
  opacity: 0.9;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--orange);
  color: var(--white);
}

.btn-small {
  padding: 6px 14px;
  font-size: 13px;
}

.btn-large {
  padding: 14px 32px;
  font-size: 16px;
  width: 100%;
  margin-top: 8px;
}

/* Sections */
.section {
  margin-bottom: 32px;
}

/* Traits grid */
.traits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.trait-card {
  background: var(--white);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border-left: 4px solid var(--orange);
}

.trait-card h3 {
  font-size: 15px;
  margin-bottom: 6px;
}

.trait-card p {
  font-size: 14px;
  color: var(--brown);
  margin: 0;
}

/* Timer bar */
.timer-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--dark);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.timer-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.timer-brand {
  font-weight: 700;
  font-size: 15px;
}

.timer-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.timer-clock {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 60px;
  text-align: right;
}

.timer-warning .timer-clock {
  color: var(--yellow);
}

.timer-critical .timer-clock {
  color: var(--red);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.save-indicator {
  font-size: 13px;
  transition: opacity 0.3s;
}

.save-indicator.saving {
  color: var(--yellow);
}

.save-indicator.saved {
  color: var(--green);
}

.save-indicator.error {
  color: var(--red);
}

/* Assessment container */
.assessment-container {
  padding-top: 80px;
}

.question-section {
  background: var(--white);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.question-section h2 {
  color: var(--orange);
  font-size: 20px;
  margin-bottom: 16px;
}

.context-block {
  background: var(--cream);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 20px;
  border-left: 4px solid var(--brown);
}

.context-block p {
  font-size: 14px;
  color: var(--brown);
  margin: 0;
  line-height: 1.7;
}

.question-part {
  margin-bottom: 24px;
}

.question-part label {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 10px;
  line-height: 1.5;
}

.answer-textarea {
  width: 100%;
  min-height: 200px;
  padding: 16px;
  border: 2px solid #E0DCD7;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.2s;
}

.answer-textarea:focus {
  outline: none;
  border-color: var(--orange);
}

.answer-textarea:disabled {
  background: var(--gray-light);
  color: var(--gray);
}

.submit-section {
  text-align: center;
  padding: 20px 0 40px;
}

.submit-section .btn {
  max-width: 400px;
}

/* Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(28,28,28,0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.overlay-content {
  background: var(--white);
  border-radius: 16px;
  padding: 48px;
  text-align: center;
  max-width: 480px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.overlay-content h2 {
  color: var(--orange);
  margin-bottom: 16px;
}

/* Alert */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

.alert-error {
  background: #FDE8E8;
  color: var(--red);
}

/* Admin styles */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
}

.admin-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-title {
  font-size: 14px;
  color: var(--brown);
  font-weight: 600;
}

.table-wrapper {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.admin-table th {
  text-align: left;
  padding: 14px 16px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--brown);
  background: var(--gray-light);
  border-bottom: 2px solid #E0DCD7;
}

.admin-table td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid #F0EEEB;
}

.clickable-row {
  cursor: pointer;
  transition: background 0.15s;
}

.clickable-row:hover {
  background: var(--cream);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-invited {
  background: #E0E0E0;
  color: #666;
}

.badge-registered {
  background: #E3F2FD;
  color: #1565C0;
}

.badge-in_progress {
  background: #FFF3E0;
  color: #E65100;
}

.badge-completed {
  background: #E8F5E9;
  color: var(--green);
}

.badge-expired {
  background: #FFEBEE;
  color: var(--red);
}

/* Candidate detail */
.candidate-info {
  background: var(--white);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.candidate-info h2 {
  margin-bottom: 16px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.info-grid div {
  font-size: 14px;
}

.response-section {
  background: var(--white);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.response-section h3 {
  color: var(--orange);
  font-size: 18px;
  margin-bottom: 16px;
}

.response-part {
  margin-bottom: 20px;
}

.response-part h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--brown);
  margin-bottom: 8px;
  line-height: 1.5;
}

.response-text {
  background: var(--cream);
  border-radius: 8px;
  padding: 16px;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 20px 16px;
  }

  .card {
    padding: 24px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .admin-header {
    flex-direction: column;
    gap: 16px;
  }

  .traits-grid {
    grid-template-columns: 1fr;
  }

  .question-section {
    padding: 20px;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }
}
