/* ===== RESET & BASE ===== */
*,*::before,*::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #1e3a5f;
  --primary-light: #2b5a8a;
  --primary-dark: #0f2744;
  --accent: #3b82f6;
  --accent-light: #60a5fa;
  --surface: #ffffff;
  --bg: #f1f5f9;
  --bg-subtle: #f8fafc;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --success: #059669;
  --success-bg: #ecfdf5;
  --error: #dc2626;
  --error-bg: #fef2f2;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 4px 24px rgba(0,0,0,.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.1);
  --transition: .2s cubic-bezier(.4,0,.2,1);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ===== HEADER ===== */
.header {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  color: #fff;
  padding: 48px 20px 56px;
  text-align: center;
}

.header-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(59,130,246,.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(59,130,246,.1) 0%, transparent 50%);
  pointer-events: none;
}

.header-content {
  position: relative;
  z-index: 1;
  max-width: 540px;
  margin: 0 auto;
}

.header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 18px;
  margin-bottom: 20px;
  backdrop-filter: blur(8px);
}

.header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 8px;
}

.header p {
  font-size: .95rem;
  opacity: .75;
  line-height: 1.5;
  font-weight: 400;
}

.btn-360 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 10px 22px;
  background: rgba(255,255,255,.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: .85rem;
  font-weight: 500;
  transition: var(--transition);
  backdrop-filter: blur(4px);
}

.btn-360:hover {
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.4);
  transform: translateY(-1px);
}

/* ===== CONTAINER ===== */
.container {
  max-width: 680px;
  margin: -28px auto 0;
  padding: 0 16px 48px;
  position: relative;
  z-index: 2;
}

/* ===== CARD ===== */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px;
  border: 1px solid var(--border-light);
}

/* ===== ALERTS ===== */
.alert {
  display: flex;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  font-size: .87rem;
  line-height: 1.5;
}

.alert-error {
  background: var(--error-bg);
  border: 1px solid #fecaca;
  color: var(--error);
}

.alert-icon { flex-shrink: 0; padding-top: 1px; }

.alert ul { list-style: none; }
.alert li { padding: 2px 0; }

/* ===== FORM SECTIONS ===== */
.form-section {
  margin-bottom: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-light);
}

.form-section:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .92rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 18px;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: .75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.optional-tag {
  font-size: .72rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg);
  padding: 3px 10px;
  border-radius: 20px;
  margin-left: auto;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ===== RADIO CARDS ===== */
.radio-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.radio-card input[type="radio"] { display: none; }

.radio-card label {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  gap: 8px;
}

.radio-card label:hover {
  border-color: var(--accent-light);
  background: var(--bg-subtle);
}

.radio-card input:checked + label {
  border-color: var(--accent);
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}

.radio-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--bg);
  border-radius: 12px;
  color: var(--text-secondary);
  transition: var(--transition);
}

.radio-card input:checked + label .radio-icon {
  background: var(--accent);
  color: #fff;
}

.radio-title {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
}

.radio-desc {
  font-size: .76rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* ===== FORM INPUTS ===== */
.form-group {
  margin-bottom: 18px;
}

.form-group:last-child {
  margin-bottom: 0;
}

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

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

.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.input-wrapper input {
  padding-left: 42px !important;
}

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: var(--transition);
  outline: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,.1);
}

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

textarea {
  resize: vertical;
  min-height: 130px;
  line-height: 1.6;
}

.field-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

.hint {
  font-size: .76rem;
  color: var(--text-muted);
}

.char-count {
  font-size: .75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.char-count.warn {
  color: #ea580c;
  font-weight: 600;
}

/* ===== FILE UPLOAD ===== */
.file-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  background: var(--bg-subtle);
}

.file-upload-area:hover,
.file-upload-area.dragover {
  border-color: var(--accent);
  background: #eff6ff;
}

.file-upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: var(--surface);
  border-radius: 14px;
  color: var(--accent);
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.upload-text {
  font-size: .88rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.upload-text strong {
  color: var(--accent);
}

.upload-hint {
  font-size: .76rem;
  color: var(--text-muted);
}

.file-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.file-item {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .84rem;
  transition: var(--transition);
}

.file-item:hover {
  background: var(--bg);
}

.file-item .file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 10px;
  font-weight: 500;
  color: var(--text);
}

.file-item .file-size {
  color: var(--text-muted);
  margin-right: 12px;
  white-space: nowrap;
  font-size: .78rem;
}

.file-item .remove-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: var(--transition);
}

.file-item .remove-btn:hover {
  background: var(--error-bg);
  color: var(--error);
}

/* ===== SUBMIT BUTTON ===== */
.btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: .3px;
  box-shadow: 0 4px 16px rgba(30,58,95,.25);
}

.btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(30,58,95,.35);
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-submit:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ===== SUCCESS SCREEN ===== */
.success-screen {
  text-align: center;
  padding: 32px 20px;
}

.success-animation {
  margin-bottom: 24px;
}

.checkmark {
  width: 72px;
  height: 72px;
}

.checkmark-circle {
  stroke: var(--success);
  stroke-width: 2;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: stroke .6s cubic-bezier(.65,0,.45,1) forwards;
}

.checkmark-check {
  stroke: var(--success);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: stroke .3s cubic-bezier(.65,0,.45,1) .5s forwards;
}

@keyframes stroke {
  100% { stroke-dashoffset: 0; }
}

.success-screen h2 {
  font-size: 1.35rem;
  color: var(--text);
  font-weight: 700;
  margin-bottom: 8px;
}

.success-desc {
  font-size: .9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 28px;
}

.protocolo-box {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 18px 36px;
  margin-bottom: 28px;
}

.protocolo-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.protocolo-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: .5px;
  font-variant-numeric: tabular-nums;
}

.btn-new {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--surface);
  color: var(--primary);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.btn-new:hover {
  border-color: var(--primary);
  background: var(--bg-subtle);
}

/* ===== SPINNER ===== */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-muted);
  font-size: .78rem;
}

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

.slide-section {
  overflow: hidden;
  transition: max-height .3s ease, opacity .3s ease;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .header { padding: 36px 16px 48px; }
  .header h1 { font-size: 1.4rem; }
  .card { padding: 24px 20px; }
  .radio-group { grid-template-columns: 1fr; }
  .input-row { grid-template-columns: 1fr; }
  .radio-card label { padding: 16px 14px; flex-direction: row; text-align: left; }
  .radio-icon { width: 40px; height: 40px; border-radius: 10px; }
  .protocolo-box { padding: 14px 24px; }
}
