:root {
  --brand-blue: #0A3296;
  --brand-blue-light: #2563EB;
  --bg-color: #f0f4f8;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: rgba(226, 232, 240, 0.8);
  --input-bg: rgba(255, 255, 255, 0.7);
  --input-focus: #ffffff;
  --glass-bg: rgb(255, 255, 255);
  --glass-border: rgba(255, 255, 255, 0.8);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
  --error: #ef4444;
  --error-bg: #fef2f2;
  --success: #10b981;
  --radius-lg: 24px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Background Animations */
.bg-elements {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.6;
  animation: float 20s infinite ease-in-out alternate;
}

.blob-1 {
  width: 500px; height: 500px;
  background: var(--brand-blue);
  top: -200px; left: -100px;
  animation-delay: 0s;
}

.blob-2 {
  width: 400px; height: 400px;
  background: #38bdf8;
  bottom: -100px; right: -50px;
  animation-delay: -5s;
}

.blob-3 {
  width: 300px; height: 300px;
  background: #818cf8;
  top: 40%; left: 60%;
  animation-delay: -10s;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, 50px) scale(1.1); }
  100% { transform: translate(-20px, 20px) scale(0.9); }
}

/* Topbar */
.topbar {
  padding: 32px 20px;
  width: 100%;
  display: flex;
  justify-content: center;
}

.topbar-inner {
  max-width: 800px;
  width: 100%;
  display: flex;
  align-items: center;
}

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

.brand-logo {
  height: 80px;
  width: auto;
  object-fit: contain;
}

.brand-text-fallback {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-weight: 800;
  font-size: 32px;
  color: var(--brand-blue);
  letter-spacing: -1px;
  line-height: 1;
}

.brand-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* Container & Card */
.container {
  flex: 1;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px 60px;
  position: relative;
  z-index: 1;
}

.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 48px;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.card-head {
  text-align: center;
  margin-bottom: 40px;
}

.icon-wrapper {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-light));
  color: white;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.25);
}

.card-head h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.lead {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Grid & Fields */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 20px;
}

.field {
  display: flex;
  flex-direction: column;
}

.field.full {
  grid-column: 1 / -1;
}

.field-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.field-head label {
  margin-bottom: 0;
}

label {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.req { color: var(--error); }
.hint { font-size: 13px; color: var(--text-muted); }

/* Inputs */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
}

input[type="text"],
input[type="email"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  color: var(--text-main);
  transition: var(--transition);
  outline: none;
}

/* Date Picker modern styling */
input[type="date"] {
  appearance: none;
  -webkit-appearance: none;
  color: var(--text-main);
}
input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.6;
  transition: var(--transition);
  padding: 4px;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

input.has-icon {
  padding-left: 48px;
}

select {
  appearance: none;
  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='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

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

input:hover, select:hover, textarea:hover {
  background: var(--input-focus);
  border-color: #cbd5e1;
}

input:focus, select:focus, textarea:focus {
  background: var(--input-focus);
  border-color: var(--brand-blue-light);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

/* Errors */
.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: var(--error);
  background: var(--error-bg);
}

.field.has-error input:focus,
.field.has-error select:focus,
.field.has-error textarea:focus {
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
}

.error {
  display: none;
  color: var(--error);
  font-size: 13.5px;
  font-weight: 500;
  margin-top: 6px;
}

.field.has-error .error { display: block; animation: fadeIn 0.3s ease; }

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

/* URLs List */
.urls-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.url-row {
  display: flex;
  gap: 12px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

.url-remove {
  background: white;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 50px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-size: 22px;
}

.url-remove:hover:not(:disabled) {
  border-color: var(--error);
  color: var(--error);
  background: var(--error-bg);
}

.url-remove:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-light));
  color: white;
  min-width: 220px;
  box-shadow: 0 4px 12px rgba(10, 50, 150, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(10, 50, 150, 0.3);
}

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

.btn-secondary {
  background: white;
  color: var(--brand-blue);
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-add {
  padding: 10px 18px;
  font-size: 14.5px;
  align-self: flex-start;
}

.actions {
  margin-top: 40px;
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid rgba(226, 232, 240, 0.6);
  padding-top: 32px;
}

/* Global Error */
.global-error {
  margin-top: 24px;
  padding: 16px 20px;
  background: var(--error-bg);
  border-left: 4px solid var(--error);
  border-radius: var(--radius-sm);
  color: var(--error);
  font-size: 14.5px;
  animation: fadeIn 0.3s ease;
}

.global-error ul {
  margin-top: 8px;
  padding-left: 20px;
}

/* Loading State */
.spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.btn.is-loading .btn-label, .btn.is-loading .btn-icon { display: none; }
.btn.is-loading .spinner { display: block; }

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

/* Success Card */
.card-success {
  text-align: center;
  padding: 64px 40px;
}

.success-icon {
  width: 88px; height: 88px;
  background: #d1fae5;
  color: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 32px;
  box-shadow: 0 12px 24px rgba(16, 185, 129, 0.2);
}

.card-success h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 16px;
}

.card-success p {
  color: var(--text-muted);
  font-size: 16px;
  margin-bottom: 40px;
}

.protocol-wrapper {
  background: rgba(255, 255, 255, 0.8);
  border: 1px dashed #cbd5e1;
  padding: 32px 40px;
  border-radius: var(--radius-lg);
  margin-bottom: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.protocol-label {
  font-size: 13.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  font-weight: 600;
}

.protocol-number {
  font-size: 36px;
  font-weight: 700;
  color: var(--brand-blue);
  letter-spacing: 2px;
}

.protocol-divider {
  width: 100%;
  height: 1px;
  background: #cbd5e1;
  margin: 24px 0;
  opacity: 0.5;
}

.protocol-wrapper .btn {
  width: 100%;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.modal-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  max-width: 580px;
  width: 100%;
  padding: 48px;
  transform: translateY(20px) scale(0.95);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
}

.modal-overlay.is-active .modal-content {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal-header {
  text-align: center;
  margin-bottom: 28px;
}

.modal-icon {
  width: 64px; height: 64px;
  background: #e0e7ff;
  color: var(--brand-blue-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.15);
}

.modal-header h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.modal-body p {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 16px;
  text-align: center;
}

.modal-highlight {
  background: #f0fdfa;
  border: 1px solid #ccfbf1;
  color: #0f766e;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  font-size: 15px;
  margin: 28px 0;
  line-height: 1.5;
}

.modal-highlight strong {
  color: #115e59;
  display: block;
  margin-bottom: 4px;
  font-size: 16px;
}

.modal-list {
  list-style: none;
  padding: 0;
  margin: 0 0 36px 0;
}

.modal-list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  color: var(--text-main);
  font-size: 15.5px;
  margin-bottom: 16px;
  line-height: 1.5;
}

.modal-list li svg {
  flex-shrink: 0;
  margin-top: 3px;
}

.modal-list li:nth-child(1) svg { color: var(--success); }
.modal-list li:nth-child(2) svg { color: var(--error); }

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

.modal-footer .btn {
  width: 100%;
}

/* Footer */
.footer {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-muted);
  font-size: 14px;
  margin-top: auto;
}

/* Responsive */
@media (max-width: 768px) {
  .glass-panel { padding: 32px 24px; }
  .grid { grid-template-columns: 1fr; gap: 20px; }
  .actions { justify-content: stretch; }
  .btn-primary { width: 100%; }
  
  .modal-content {
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px 24px;
  }
}
@media (max-width: 480px) {
  .topbar { padding: 24px 16px; }
  .container { padding: 0 16px 40px; }
  .glass-panel { padding: 28px 20px; border-radius: 20px; }
  .card-head h1 { font-size: 26px; }
  .brand-name { font-size: 28px; }
  .brand-logo { height: 56px; }
  .url-remove { width: 44px; }
  .protocol-wrapper { padding: 20px; width: 100%; }
  .protocol-number { font-size: 28px; }
  
  .modal-content {
    padding: 24px 20px;
    max-height: 95vh;
  }
  .modal-icon { width: 48px; height: 48px; margin-bottom: 12px; }
  .modal-header h2 { font-size: 22px; }
  .modal-body p { font-size: 14.5px; }
  .modal-highlight { padding: 14px; margin: 20px 0; font-size: 14px; }
  .modal-list li { font-size: 14px; gap: 10px; margin-bottom: 12px; }
}
