/* Aineiston toimitus: lomake (aineisto.php ja modaali) sekä tiimin lataussivu. */

.aineisto-page.container { max-width: 800px; padding-top: 140px; padding-bottom: 96px; }
.aineisto-page h1 { font-size: clamp(36px, 6vw, 56px); line-height: 1.1; margin: 18px 0 20px; }
.aineisto-intro { margin: 0 0 36px; color: var(--text-muted); font-size: 19px; line-height: 1.6; }

.aineisto-form { display: grid; gap: 20px; }
.aineisto-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.aineisto-fields .aineisto-wide { grid-column: 1 / -1; }
.aineisto-form label { display: block; margin-bottom: 6px; color: var(--navy-dark); font-size: 14px; font-weight: 700; }
.aineisto-form label span { color: var(--text-muted); font-weight: 500; }
.aineisto-form input:not([type="file"]),
.aineisto-form textarea {
  box-sizing: border-box; width: 100%; min-width: 0; padding: 12px 14px;
  border: 1px solid #c8ccd8; border-radius: 12px; background: #fff;
  color: var(--text); font: inherit; font-size: 15px;
}
.aineisto-form textarea { resize: vertical; }
.aineisto-form input::placeholder,
.aineisto-form textarea::placeholder { color: #7c8190; opacity: 1; }
.aineisto-form input:focus-visible,
.aineisto-form textarea:focus-visible { outline: 3px solid rgba(233, 30, 133, 0.33); border-color: var(--pink); }
.aineisto-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.aineisto-drop {
  position: relative; padding: 28px 20px; border: 2px dashed #c8ccd8; border-radius: 16px;
  background: var(--surface); text-align: center; transition: border-color 0.18s, background 0.18s;
}
.aineisto-drop.is-over { border-color: var(--pink); background: var(--pink-50); }
.aineisto-drop:focus-within { outline: 3px solid rgba(233, 30, 133, 0.33); outline-offset: 2px; }
.aineisto-drop input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.aineisto-form .aineisto-drop label { margin: 0; color: var(--text); font-size: 16px; font-weight: 500; }
.aineisto-drop label strong { color: var(--navy); }
.aineisto-limits { margin: 8px 0 0; color: var(--text-muted); font-size: 13px; line-height: 1.5; }

.aineisto-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.aineisto-list:empty { display: none; }
.aineisto-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 4px 12px;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: #fff; font-size: 14px;
}
.aineisto-item-name { overflow: hidden; color: var(--text); text-overflow: ellipsis; white-space: nowrap; }
.aineisto-item-size { color: var(--text-muted); white-space: nowrap; }
.aineisto-item-remove {
  width: 28px; height: 28px; border: 0; border-radius: 8px;
  background: var(--surface-2); color: var(--text-muted); font-size: 18px; cursor: pointer;
}
.aineisto-item progress { grid-column: 1 / -1; width: 100%; height: 6px; border: 0; border-radius: 3px; background: var(--surface-2); appearance: none; }
.aineisto-item progress::-webkit-progress-bar { border-radius: 3px; background: var(--surface-2); }
.aineisto-item progress::-webkit-progress-value { border-radius: 3px; background: var(--grad); }
.aineisto-item progress::-moz-progress-bar { border-radius: 3px; background: var(--grad); }
.aineisto-item-note { grid-column: 1 / -1; color: var(--text-muted); font-size: 13px; }
.aineisto-item-note:empty { display: none; }
.aineisto-item.is-error { border-color: rgba(230, 70, 68, 0.35); }
.aineisto-item.is-error .aineisto-item-note { color: #b91c1c; }
.aineisto-item.is-done .aineisto-item-note { color: #15803d; }

.aineisto-privacy { margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.55; }
.aineisto-privacy a { color: var(--navy); text-decoration: underline; text-underline-offset: 3px; }
.aineisto-submit {
  display: inline-flex; align-items: center; justify-content: center; justify-self: start;
  min-height: 48px; padding: 14px 24px; border: 0; border-radius: 12px;
  background: var(--navy); color: #fff; font: inherit; font-weight: 700; cursor: pointer;
}
.aineisto-submit:hover { background: var(--navy-dark); }
.aineisto-submit:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }
.aineisto-submit:disabled { opacity: 0.6; cursor: wait; }
.aineisto-status { min-height: 1.4em; margin: 0; color: var(--text-muted); font-size: 14px; line-height: 1.55; }
.aineisto-status.is-error { color: #b91c1c; }

.aineisto-done { padding: 24px; border-radius: 16px; background: var(--navy-50); }
.aineisto-done:focus { outline: none; }
.aineisto-done h3 { margin: 0 0 8px; color: var(--navy-dark); }
.aineisto-done p { margin: 0; line-height: 1.6; }
.aineisto-rejected { margin-top: 8px; color: #b91c1c; }

.aineisto-other { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); }
.aineisto-other h3 { margin: 0 0 12px; font-size: 17px; }
.aineisto-other ul,
.aineisto-guide ul { display: grid; gap: 8px; margin: 0; padding-left: 20px; color: var(--text-muted); font-size: 15px; line-height: 1.55; }
.aineisto-other a,
.aineisto-guide a { color: var(--navy); text-decoration: underline; text-underline-offset: 3px; }
.aineisto-guide { margin-top: 56px; }
.aineisto-guide h2 { margin: 0 0 16px; font-size: 24px; }

.aineisto-box [hidden],
.aineisto-dialog [hidden] { display: none !important; }

.aineisto-dialog {
  width: min(680px, calc(100vw - 32px)); max-height: min(92dvh, 900px); margin: auto; padding: 0; overflow: auto;
  border: 1px solid #e8eaef; border-radius: 20px; background: #fff; color: var(--text);
  box-shadow: 0 28px 80px rgba(18, 26, 59, 0.28);
}
.aineisto-dialog::backdrop { background: rgba(15, 21, 41, 0.62); }
.aineisto-dialog-inner { padding: 28px 32px 30px; }
.aineisto-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.aineisto-dialog-head h2 { margin: 0; font-size: 24px; }
.aineisto-dialog-head h2:focus { outline: none; }
.aineisto-dialog-close {
  display: grid; width: 36px; height: 36px; place-items: center; border: 0; border-radius: 10px;
  background: #f2f4f8; color: var(--navy-dark); font-size: 22px; cursor: pointer;
}

.aineisto-admin { max-width: 720px; margin: 0 auto; padding: 56px 24px; font-family: var(--font); }
.aineisto-admin h1 { margin: 0 0 8px; font-size: 28px; }
.aineisto-admin dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 24px 0; }
.aineisto-admin dt { color: var(--navy-dark); font-weight: 700; }
.aineisto-admin dd { margin: 0; white-space: pre-wrap; }
.aineisto-admin .aineisto-item-name { color: var(--navy); font-weight: 700; }
.aineisto-login { display: grid; gap: 12px; max-width: 360px; margin-top: 24px; }
.aineisto-login input { padding: 12px 14px; border: 1px solid #c8ccd8; border-radius: 12px; font: inherit; }
.aineisto-error { color: #b91c1c; }

@media (max-width: 600px) {
  .aineisto-page.container { padding-top: 110px; }
  .aineisto-fields { grid-template-columns: 1fr; }
  .aineisto-dialog-inner { padding: 22px 18px 24px; }
}
