*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: 'Proxima Nova', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: #000;
  background: rgba(0, 119, 200, 0.04);
  -webkit-font-smoothing: antialiased;
}

.page-title {
  margin: 0;
  font-size: clamp(0.875rem, 0.5625rem + 1vw, 1.1875rem);
  font-weight: 700;
  line-height: 1.2;
  color: #000;
}

.access-request-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ebe8e4;
  padding: 24px;
}

.login-form-card,
.access-request-page__card {
  width: 100%;
  max-width: 760px;
  background: #fff;
  padding: 40px 32px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-radius: 12px;
}

.access-request-page__title {
  margin: 0;
}

.access-request-page__template-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 100%;
  margin-top: 20px;
  padding: 12px 18px;
  border: 1px solid #cce4f3;
  border-radius: 8px;
  background: #f0f8fd;
  color: #0077c8;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  text-align: left;
  transition: background-color 0.15s, border-color 0.15s;
}

.access-request-page__template-link:visited {
  color: #0077c8;
}

.access-request-page__template-link:hover {
  background: #e4f2fb;
  border-color: #96c9e9;
  color: #005c9b;
  text-decoration: none;
}

.access-request-page__template-link:focus-visible {
  outline: 2px solid #0077c8;
  outline-offset: 3px;
}

.access-request-page__template-icon {
  flex: 0 0 20px;
}

.access-request-page__header {
  text-align: center;
  margin-bottom: 28px;
}

.access-request-page__logo {
  height: 56px;
  width: auto;
  margin-bottom: 16px;
}

.access-request-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.form-field {
  margin-bottom: 18px;
}

.form-field.is-hidden {
  display: none;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.875rem;
  line-height: 1.2;
  color: #8c8279;
}

.form-label .required {
  color: #a6192e;
}

.form-input {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(215, 210, 203, 0.55);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  color: #000;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238c8279' d='M1.4.6L6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-input::placeholder {
  font-size: 0.75rem;
  color: #8c8279;
}

.form-input:focus {
  outline: none;
  border-color: #0077c8;
  box-shadow: 0 0 0 1px #0077c8 inset, 0 0 0 3px rgba(0, 119, 200, 0.2);
}

.form-input[readonly] {
  background: #f5f3f1;
  color: #6e6259;
}

.form-input-wrap {
  position: relative;
}

.form-input-wrap .form-input {
  padding-right: 36px;
}

.form-input-spinner {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border: 2px solid rgba(0, 119, 200, 0.2);
  border-top-color: #0077c8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

.form-input-spinner.is-visible {
  display: block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.form-error {
  display: none;
  margin-top: 4px;
  font-size: 0.75rem;
  color: #a6192e;
}

.form-field.is-invalid .form-input,
.form-field.is-invalid .form-select,
.form-field.is-invalid .file-dropzone {
  border-color: #a6192e;
  box-shadow: 0 0 0 1px #a6192e inset;
}

.form-field.is-invalid .form-error {
  display: block;
}

.file-dropzone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 112px;
  padding: 16px;
  border: 1.5px dashed rgba(0, 119, 200, 0.45);
  border-radius: 8px;
  background: rgba(0, 119, 200, 0.04);
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.file-dropzone:hover,
.file-dropzone:focus-visible {
  outline: none;
  border-color: #0077c8;
  background: rgba(0, 119, 200, 0.08);
}

.file-dropzone.is-dragover {
  border-color: #0077c8;
  background: rgba(0, 119, 200, 0.12);
  box-shadow: 0 0 0 3px rgba(0, 119, 200, 0.15);
}

.file-dropzone__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-dropzone__content {
  pointer-events: none;
  text-align: center;
}

.file-dropzone__title {
  margin: 0 0 6px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #0033a0;
}

.file-dropzone__hint {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #8c8279;
}

.file-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-list[hidden] {
  display: none;
}

.file-list__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(215, 210, 203, 0.55);
  border-radius: 8px;
  background: #faf9f8;
}

.file-list__name {
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  color: #4a423c;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-list__size {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: #8c8279;
}

.file-list__remove {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: #a6192e;
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
  padding: 2px 4px;
}

.file-list__remove:hover {
  text-decoration: underline;
}

.alert {
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.4;
}

.alert--warning {
  background: rgba(255, 163, 0, 0.12);
  color: #6e6259;
  border: 1px solid rgba(255, 163, 0, 0.35);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
  padding: 12px 20px;
  border: 1px solid #0077c8;
  border-radius: 8px;
  background: #0077c8;
  font: inherit;
  font-size: 1rem;
  color: #fff;
  cursor: pointer;
  transition: background 0.18s, opacity 0.18s;
}

.btn:hover:not(:disabled) {
  background: #0033a0;
  border-color: #0033a0;
}

.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

.btn.is-loading .btn-spinner {
  display: block;
}

.access-request-page__result {
  text-align: center;
  padding: 8px 0 4px;
}

.access-request-page__result-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: #006f44;
}

.access-request-page__result-title {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  color: #000;
}

.access-request-page__result-number {
  margin: 0;
  padding: 12px 16px;
  background: #f0eeeb;
  border-radius: 8px;
  color: #4a423c;
}

.access-request-page__result-number strong {
  font-weight: 600;
  color: #0033a0;
}

.access-request-page__summary {
  margin-top: 24px;
  text-align: left;
  padding: 16px;
  background: #f0eeeb;
  border-radius: 8px;
}

.access-request-page__summary-title {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 600;
  color: #000;
  text-align: center;
}

.access-request-page__summary-list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.access-request-page__summary-row {
  display: grid;
  grid-template-columns: minmax(140px, 40%) 1fr;
  gap: 8px 16px;
  align-items: start;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.access-request-page__summary-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.access-request-page__summary-row dt {
  margin: 0;
  color: #6e6259;
  font-size: 0.875rem;
  line-height: 1.4;
}

.access-request-page__summary-row dd {
  margin: 0;
  color: #4a423c;
  font-weight: 600;
  line-height: 1.4;
  word-break: break-word;
}

.access-request-page__summary-files {
  margin: 0;
  padding-left: 1.1em;
  list-style: disc;
}

.access-request-page__summary-files li {
  margin: 0 0 4px;
}

.access-request-page__summary-files li:last-child {
  margin-bottom: 0;
}

.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}

.toast {
  padding: 12px 16px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  font-size: 0.875rem;
  line-height: 1.4;
  color: #4a423c;
  animation: toast-in 0.2s ease;
}

.toast--error {
  border-left: 4px solid #a6192e;
}

.toast--warning {
  border-left: 4px solid #ffa300;
}

.toast--success {
  border-left: 4px solid #006f44;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.is-hidden {
  display: none !important;
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .access-request-page__summary-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .access-request-page {
    padding: 16px;
  }

  .login-form-card,
  .access-request-page__card {
    padding: 28px 18px;
  }

  .file-dropzone {
    min-height: 100px;
    padding: 14px 12px;
  }

  .file-list__item {
    flex-wrap: wrap;
  }

  .file-list__name {
    flex-basis: calc(100% - 80px);
  }
}

