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

:root {
  --color-bg: #f0f4f8;
  --color-surface: #ffffff;
  --color-primary: #2b4f60;
  --color-primary-light: #3a6b80;
  --color-accent: #0ea5e9;
  --color-accent-hover: #0284c7;
  --color-text: #1e293b;
  --color-text-secondary: #64748b;
  --color-border: #e2e8f0;
  --color-error: #dc2626;
  --color-success: #16a34a;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 4px 24px rgba(0, 0, 0, 0.08);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --transition: 0.2s ease;
}

html {
  height: 100%;
}

body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

/* ===== Main Content ===== */
#econtent {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 20px 40px;
  gap: 20px;
}

/* ===== Card ===== */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 32px;
  width: 100%;
  max-width: 560px;
}

.card-header {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
}

#maintitle {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 2px;
  line-height: 1.3;
}

.title-logo {
  text-decoration: none;
  vertical-align: middle;
}

.title-logo img {
  height: 1.1em;
  vertical-align: baseline;
  margin: 0 2px;
}

.title-logo:not(:has(img)) {
  color: var(--color-accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.subtitle {
  color: var(--color-text-secondary);
  font-size: 13px;
  margin: 0;
}

/* ===== Form ===== */
.form-group {
  margin-bottom: 20px;
}

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

.hint {
  font-weight: 400;
  color: var(--color-text-secondary);
}

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

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

/* ===== Dropzone ===== */
.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px 20px;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--color-accent);
  background: #f0f9ff;
}

.dropzone-icon {
  width: 36px;
  height: 36px;
  color: var(--color-text-secondary);
  transition: color var(--transition);
}

.dropzone:hover .dropzone-icon,
.dropzone.dragover .dropzone-icon {
  color: var(--color-accent);
}

.dropzone-text {
  font-size: 14px;
  color: var(--color-text-secondary);
}

.dropzone-link {
  color: var(--color-accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* ===== File list ===== */
.file-list {
  list-style: none;
  margin-top: 10px;
}

.file-list:empty {
  display: none;
}

.file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  margin-bottom: 4px;
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.file-list .file-name {
  color: var(--color-text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 320px;
}

.file-list .file-size {
  color: var(--color-text-secondary);
  font-size: 12px;
  white-space: nowrap;
  margin-left: 12px;
}

.file-list .file-remove {
  margin-left: 12px;
  background: none;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
  border-radius: 4px;
  transition: color var(--transition), background var(--transition);
}

.file-list .file-remove:hover {
  color: var(--color-error);
  background: #fef2f2;
}

.file-list li.oversize {
  border-color: var(--color-error);
  background: #fef2f2;
}

.file-list li.oversize .file-size {
  color: var(--color-error);
  font-weight: 600;
}

/* ===== Field Errors ===== */
.field-error {
  color: var(--color-error);
  font-size: 13px;
  margin-top: 6px;
  min-height: 0;
}

.field-error:empty {
  display: none;
}

/* ===== Progress ===== */
.progress-wrap {
  margin-bottom: 20px;
  display: none;
  align-items: center;
  gap: 12px;
}

.progress {
  flex: 1;
  height: 8px;
  background: var(--color-border);
  border-radius: 99px;
  overflow: hidden;
}

.bar {
  height: 100%;
  width: 0%;
  background: var(--color-accent);
  border-radius: 99px;
  transition: width 0.3s ease;
}

.percent {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  min-width: 40px;
  text-align: right;
}

/* ===== Submit Button ===== */
.btn-submit {
  display: block;
  width: 100%;
  padding: 12px 24px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--color-accent);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
}

.btn-submit:hover {
  background: var(--color-accent-hover);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

.btn-submit:active {
  transform: scale(0.985);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ===== Status Card ===== */
.status-card {
  display: none;
  text-align: center;
  font-size: 14px;
  line-height: 1.7;
}

.status-card p {
  margin-bottom: 8px;
}

.status-card a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ===== Footer ===== */
#footer {
  text-align: center;
  padding: 16px 20px;
  font-size: 12px;
  color: var(--color-text-secondary);
  font-family: var(--font);
}

#footer a {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition);
}

#footer a:hover {
  color: var(--color-text);
}

/* ===== Validation States ===== */
input.error,
textarea.error {
  border-color: var(--color-error) !important;
  background-color: #fef2f2;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  #econtent {
    padding: 12px 12px 24px;
  }

  .card {
    padding: 24px 18px;
  }

  #maintitle {
    font-size: 17px;
  }

  .dropzone {
    padding: 24px 16px;
  }

  .file-list .file-name {
    max-width: 180px;
  }
}
