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

:root {
  --primary:        #1a73e8;
  --primary-dark:   #1557b0;
  --primary-light:  #e8f0fe;
  --surface:        #ffffff;
  --bg:             #f1f3f4;
  --on-surface:     #202124;
  --on-surface-mid: #5f6368;
  --on-surface-low: #9aa0a6;
  --error:          #d93025;
  --success:        #1e8e3e;
  --border:         #dadce0;
  --shadow-1: 0 1px 2px rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
  --shadow-2: 0 1px 3px rgba(60,64,67,.3), 0 4px 8px 3px rgba(60,64,67,.15);
  --shadow-3: 0 2px 6px rgba(60,64,67,.3), 0 6px 20px 4px rgba(60,64,67,.15);
  --radius:   12px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
  height: 100%;
  font-family: 'Roboto', sans-serif;
  font-size: 16px;
  color: var(--on-surface);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Page background pattern
   ============================================================ */
.page-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 10%, #c5d9fc 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 90%, #d2e3fc 0%, transparent 55%),
    var(--bg);
  z-index: 0;
}

/* ============================================================
   Layout
   ============================================================ */
.card-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  width: 100%;
  max-width: 520px;
  padding: 36px 40px 40px;
  animation: card-in 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Card Header
   ============================================================ */
.card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

.header-icon {
  font-size: 40px;
  color: var(--primary);
  background: var(--primary-light);
  border-radius: 50%;
  padding: 10px;
  flex-shrink: 0;
}

.card-title {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.15px;
  color: var(--on-surface);
}

.card-subtitle {
  font-size: 14px;
  color: var(--on-surface-mid);
  margin-top: 2px;
}

/* ============================================================
   Fields (Outlined Material style)
   ============================================================ */
.field {
  position: relative;
  margin-bottom: 24px;
}

.field input {
  width: 100%;
  height: 56px;
  padding: 16px 48px 0 48px;
  font-family: 'Roboto', sans-serif;
  font-size: 16px;
  color: var(--on-surface);
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  outline: none;
  transition: border-color var(--transition);
  appearance: none;
}

.field label {
  position: absolute;
  left: 48px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--on-surface-mid);
  pointer-events: none;
  transition: all var(--transition);
  background: var(--surface);
  padding: 0 4px;
  transform-origin: left top;
}

/* Float label when input has content or is focused */
.field input:focus ~ label,
.field input:not(:placeholder-shown) ~ label {
  top: 0;
  transform: translateY(-50%) scale(0.75);
  color: var(--primary);
  left: 44px;
}

.field input:not(:focus):not(:placeholder-shown) ~ label {
  color: var(--on-surface-mid);
}

.field input:focus {
  border-color: var(--primary);
  border-width: 2px;
}

.field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--on-surface-low);
  pointer-events: none;
  transition: color var(--transition);
}

.field input:focus ~ .field-icon {
  color: var(--primary);
}

/* Validation states */
.field.invalid input { border-color: var(--error); }
.field.invalid label,
.field.invalid .field-icon { color: var(--error); }

.error-msg {
  display: none;
  font-size: 12px;
  color: var(--error);
  margin-top: 4px;
  margin-left: 48px;
}

.field.invalid .error-msg { display: block; }

/* ============================================================
   Drag & Drop Zone
   ============================================================ */
.drop-zone {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  margin-bottom: 24px;
  outline: none;
}

.drop-zone:hover,
.drop-zone:focus {
  border-color: var(--primary);
  background: var(--primary-light);
}

.drop-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: inset 0 0 0 3px rgba(26,115,232,0.15);
}

.drop-zone.invalid-drop {
  border-color: var(--error);
}

.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.drop-zone-content { pointer-events: none; }

.drop-icon {
  font-size: 48px;
  color: var(--primary);
  display: block;
  margin-bottom: 8px;
  transition: transform var(--transition);
}

.drop-zone:hover .drop-icon,
.drop-zone.dragover .drop-icon {
  transform: translateY(-4px);
}

.drop-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--on-surface);
  margin-bottom: 4px;
}

.drop-sub {
  font-size: 13px;
  color: var(--on-surface-mid);
}

.browse-link {
  color: var(--primary);
  font-weight: 500;
  cursor: pointer;
  pointer-events: auto;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* File preview */
.file-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  pointer-events: none;
}

.file-icon {
  font-size: 36px;
  color: var(--primary);
  flex-shrink: 0;
}

.file-info {
  flex: 1;
  overflow: hidden;
}

.file-name {
  display: block;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--on-surface);
}

.file-size {
  display: block;
  font-size: 12px;
  color: var(--on-surface-mid);
  margin-top: 2px;
}

.remove-file {
  pointer-events: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--on-surface-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 4px;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}

.remove-file:hover {
  background: rgba(0,0,0,0.06);
  color: var(--error);
}

/* ============================================================
   CAPTCHA Container
   ============================================================ */
.captcha-container {
  margin-bottom: 24px;
  display: flex;
  justify-content: center;
}

/* ============================================================
   Submit Button
   ============================================================ */
.btn-submit {
  width: 100%;
  height: 48px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-family: 'Roboto', sans-serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.1px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-1);
  transition: background var(--transition), box-shadow var(--transition), transform 0.1s;
  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.08); }
.btn-submit:active { transform: scale(0.99); box-shadow: none; }

.btn-submit:disabled {
  background: var(--border);
  color: var(--on-surface-low);
  cursor: not-allowed;
  box-shadow: none;
}

/* Loading spinner */
.spin {
  animation: spin 0.8s linear infinite;
  font-size: 22px;
}

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

/* ============================================================
   Progress bar (shown during S3 upload)
   ============================================================ */
.progress-wrap {
  margin-top: 16px;
  display: none;
}

.progress-label {
  font-size: 13px;
  color: var(--on-surface-mid);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}

.progress-bar-track {
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* ============================================================
   Status Banner
   ============================================================ */
.status-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 14px;
  animation: fade-in 0.3s ease;
}

.status-banner.success {
  background: #e6f4ea;
  color: var(--success);
}

.status-banner.error {
  background: #fce8e6;
  color: var(--error);
}

.status-icon { font-size: 20px; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Ripple effect
   ============================================================ */
.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: ripple 0.5s linear;
  background: rgba(255,255,255,0.35);
  pointer-events: none;
}

@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 560px) {
  .card { padding: 28px 20px 32px; }
  .card-title { font-size: 18px; }
}
