/* ============================================
   Speak UP – Madina Group | Global Styles
   Mobile-First, Corporate Design
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── CSS Custom Properties ── */
:root {
  --navy-900: #05152B;
  --navy-800: #0A2540;
  --navy-700: #1A3A5C;
  --navy-600: #1A5276;
  --blue-400: #2E86C1;
  --blue-300: #3498DB;
  --amber:    #F39C12;
  --amber-lt: #F5CBA7;
  --white:    #FFFFFF;
  --gray-50:  #F8FAFC;
  --gray-100: #EEF2F7;
  --gray-200: #D5E0EC;
  --gray-400: #94A3B8;
  --gray-600: #64748B;
  --danger:   #E74C3C;
  --success:  #27AE60;
  --critical: #C0392B;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-card: 0 8px 40px rgba(5,21,43,0.35), 0 2px 8px rgba(5,21,43,0.18);
  --shadow-input: 0 0 0 3px rgba(46,134,193,0.25);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--navy-800);
  background: linear-gradient(145deg, var(--navy-900) 0%, var(--navy-700) 50%, var(--navy-900) 100%);
  min-height: 100vh;
  padding: 20px 16px 40px;
}

/* ── Page Header ── */
.page-header {
  text-align: center;
  padding: 28px 16px 20px;
  color: var(--white);
}

.logo-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
}

.logo-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--amber) 0%, #E67E22 100%);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 4px 16px rgba(243,156,18,0.4);
  flex-shrink: 0;
}

.page-header h1 {
  font-size: clamp(22px, 5vw, 32px);
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.page-header h1 span {
  color: var(--amber);
  display: block;
  font-size: 0.65em;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.9;
}

.header-tagline {
  font-size: 13px;
  color: var(--gray-200);
  margin-top: 6px;
  opacity: 0.8;
}

/* ── Card Container ── */
.form-card {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(255,255,255,0.2);
  max-width: 720px;
  margin: 0 auto;
  overflow: hidden;
}

/* ── Section Dividers ── */
.form-section {
  padding: 24px 24px 0;
}
.form-section:last-of-type { padding-bottom: 24px; }

.section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--blue-400);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: '';
  width: 4px;
  height: 16px;
  background: var(--amber);
  border-radius: 2px;
  flex-shrink: 0;
}

.form-divider {
  height: 1px;
  background: var(--gray-100);
  margin: 0 24px;
}

/* ── Form Fields ── */
.form-group {
  margin-bottom: 18px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy-700);
  margin-bottom: 6px;
}

label .required-star {
  color: var(--danger);
  margin-left: 3px;
}

label .lang-hint {
  font-weight: 400;
  color: var(--gray-400);
  font-size: 12px;
  margin-left: 4px;
}

input[type="text"],
input[type="email"],
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  color: var(--navy-800);
  background: var(--white);
  appearance: none;
  -webkit-appearance: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
  border-color: var(--blue-400);
  box-shadow: var(--shadow-input);
}

input[type="text"].error,
input[type="email"].error,
select.error,
textarea.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(231,76,60,0.15);
}

.error-msg {
  color: var(--danger);
  font-size: 12px;
  margin-top: 4px;
  display: none;
}
.error-msg.visible { display: block; }

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='%231A3A5C' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

/* ── Radio Group (User Type) ── */
.radio-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.radio-pill {
  flex: 1;
  min-width: 130px;
}

.radio-pill input[type="radio"] {
  display: none;
}

.radio-pill label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 10px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-600);
  background: var(--gray-50);
  transition: all var(--transition);
  text-align: center;
  margin-bottom: 0;
}

.radio-pill input[type="radio"]:checked + label {
  border-color: var(--navy-800);
  background: var(--navy-800);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(10,37,64,0.3);
}

.radio-pill label:hover {
  border-color: var(--blue-400);
  color: var(--blue-400);
}

/* ── Employee Fields Toggle ── */
#employee-fields {
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4,0,0.2,1), opacity 0.3s ease;
}

#employee-fields.hidden {
  max-height: 0 !important;
  opacity: 0;
  pointer-events: none;
}

#employee-fields.visible {
  opacity: 1;
}

/* ── Urgency Badges ── */
.urgency-select option[value="Low"]      { color: #27AE60; }
.urgency-select option[value="Medium"]   { color: #E67E22; }
.urgency-select option[value="High"]     { color: #E74C3C; }
.urgency-select option[value="Critical"] { color: var(--critical); font-weight: 700; }

/* ── File Upload ── */
.upload-zone {
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  background: var(--gray-50);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--blue-400);
  background: #EBF5FB;
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.upload-icon { font-size: 36px; margin-bottom: 8px; }
.upload-text { font-weight: 600; color: var(--navy-700); margin-bottom: 4px; }
.upload-subtext { font-size: 12px; color: var(--gray-400); }

.upload-limit-badge {
  display: inline-block;
  background: var(--amber-lt);
  color: #7D5500;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  margin-top: 10px;
  letter-spacing: 0.5px;
}

/* ── Image Previews ── */
#file-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.preview-item {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  animation: popIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 1; transform: scale(1); }
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  background: rgba(231,76,60,0.92);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background var(--transition), transform var(--transition);
}
.preview-remove:hover {
  background: var(--danger);
  transform: scale(1.1);
}

.file-count-badge {
  font-size: 12px;
  color: var(--gray-600);
  margin-top: 8px;
  font-weight: 500;
}

/* ── Submit Button ── */
.btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  background: linear-gradient(135deg, var(--navy-800) 0%, var(--blue-400) 100%);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  margin-top: 28px;
  box-shadow: 0 4px 16px rgba(10,37,64,0.4);
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-submit::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition);
}
.btn-submit:hover::after { background: rgba(255,255,255,0.06); }

.btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(10,37,64,0.5);
}

.btn-submit:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(10,37,64,0.35);
}

.btn-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* ── Loading Overlay ── */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5,21,43,0.75);
  backdrop-filter: blur(6px);
  z-index: 1000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  color: var(--white);
}
.loading-overlay.active { display: flex; }

.spinner {
  width: 56px;
  height: 56px;
  border: 4px solid rgba(255,255,255,0.2);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 16px;
  font-weight: 600;
  opacity: 0.9;
}

/* ── Success Screen ── */
.success-screen {
  display: none;
  position: fixed;
  inset: 0;
  background: linear-gradient(145deg, var(--navy-900) 0%, var(--navy-700) 100%);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
  color: var(--white);
}
.success-screen.active { display: flex; }

.success-icon {
  width: 90px;
  height: 90px;
  background: linear-gradient(135deg, var(--success), #1E8449);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  margin-bottom: 24px;
  box-shadow: 0 8px 32px rgba(39,174,96,0.5);
  animation: successPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes successPop {
  from { opacity: 0; transform: scale(0.5); }
  to   { opacity: 1; transform: scale(1); }
}

.success-screen h2 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 12px;
}
.success-screen p {
  font-size: 15px;
  color: var(--gray-200);
  max-width: 400px;
  line-height: 1.6;
}

.btn-new-report {
  margin-top: 32px;
  min-height: 50px;
  padding: 12px 32px;
  background: var(--amber);
  color: var(--navy-900);
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(243,156,18,0.4);
  transition: transform var(--transition), box-shadow var(--transition);
}
.btn-new-report:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(243,156,18,0.5);
}

/* ── Error Box ── */
.error-box {
  display: none;
  background: #FDEDEC;
  border: 1.5px solid #E74C3C;
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-top: 16px;
  gap: 12px;
  align-items: flex-start;
}
.error-box.active { display: flex; }

.error-box-icon { font-size: 22px; flex-shrink: 0; margin-top: 1px; }
.error-box-body {}
.error-box-title { font-size: 14px; font-weight: 700; color: var(--danger); }
.error-box-msg   { font-size: 13px; color: #922B21; margin-top: 3px; }

.btn-retry {
  margin-top: 10px;
  padding: 8px 20px;
  background: var(--danger);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background var(--transition);
}
.btn-retry:hover { background: #C0392B; }

/* ── Footer ── */
.form-footer {
  text-align: center;
  padding: 16px 24px 24px;
  font-size: 12px;
  color: var(--gray-400);
}

/* ── Urgency Indicator ── */
.urgency-indicator {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}
.urgency-indicator.visible { display: flex; }
.urgency-indicator svg { flex-shrink: 0; }
.urgency-Critical {
  background: #FDEDEC;
  color: var(--critical);
  border: 1px solid #E74C3C;
}
.urgency-High {
  background: #FEF9E7;
  color: #B7770D;
  border: 1px solid #F39C12;
}

/* ── Responsive ── */
@media (min-width: 600px) {
  .form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
}

@media (max-width: 599px) {
  body { padding: 12px 8px 40px; }
  .form-section { padding: 20px 16px 0; }
  .form-divider { margin: 0 16px; }
  .form-footer  { padding: 16px 16px 20px; }
}
