/* Education Loan Document Upload Portal — brand dark theme */
:root {
  --color-bg: #0a0a0a;
  --color-surface: #111111;
  --color-text: #ffffff;
  --color-muted: #9ca3af;
  --color-primary: #dc2626;
  --color-accent: #ef4444;
}

.portal-body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(165deg, #0a0a0a 0%, #111111 45%, #1a0a0a 100%);
  color: var(--color-text);
  font-family: var(--font-body, system-ui, sans-serif);
}

.portal-header {
  background: linear-gradient(90deg, #0a0a0a, #121212);
  border-bottom: 1px solid rgba(220, 38, 38, 0.22);
  color: var(--color-surface);
  padding: 0.875rem 1rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.portal-header__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.portal-logo {
  color: var(--color-surface);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
}

.portal-badge {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.15);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

.portal-header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.portal-user {
  font-size: 0.875rem;
  opacity: 0.9;
}

.portal-main {
  max-width: 520px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.portal-main--wide {
  max-width: 1100px;
}

.portal-card {
  background: var(--color-surface);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(220, 38, 38, 0.18);
}

.portal-card--narrow {
  max-width: 520px;
  margin: 0 auto;
}

.portal-title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.35rem, 4vw, 1.65rem);
  font-weight: 700;
  line-height: 1.2;
}

.portal-lead {
  margin: 0 0 1.5rem;
  color: var(--color-muted);
  font-size: 0.95rem;
}

.portal-form .form-error {
  display: block;
  color: #b91c1c;
  font-size: 0.8rem;
  margin-top: 0.25rem;
  min-height: 1rem;
}

.portal-filters .form-field {
  margin: 0;
}

.portal-form-message {
  margin-top: 1rem;
  font-size: 0.9rem;
  min-height: 1.25rem;
}

.portal-form-message.is-error {
  color: #b91c1c;
}

.portal-form-message.is-success {
  color: var(--color-accent);
}

.portal-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.portal-progress-wrap {
  min-width: 200px;
  flex: 1;
  max-width: 320px;
}

.portal-progress {
  height: 10px;
  background: rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.portal-progress__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent), var(--color-primary));
  border-radius: 999px;
  transition: width 0.35s ease;
}

.portal-progress__label {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.portal-section {
  margin-bottom: 2rem;
}

.portal-section__title {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}

.portal-section__desc {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--color-muted);
}

.portal-alert {
  padding: 1rem 1.25rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.portal-alert--success {
  background: rgba(220, 38, 38, 0.12);
  color: var(--color-accent);
  border: 1px solid rgba(220, 38, 38, 0.35);
}

.co-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

@media (max-width: 640px) {
  .co-type-grid {
    grid-template-columns: 1fr;
  }
}

.co-type-option {
  display: block;
  cursor: pointer;
  border: 2px solid var(--form-field-border);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  background: var(--form-field-bg);
}

.co-type-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.co-type-option--active,
.co-type-option:has(input:checked) {
  border-color: var(--color-primary);
  background: rgba(220, 38, 38, 0.12);
}

.co-type-option__label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--form-value-color);
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.doc-card {
  background: var(--color-surface);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 1rem;
}

.doc-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.doc-card__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.doc-card__badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}

.doc-card__badge--pending {
  background: rgba(248, 113, 113, 0.15);
  color: #92400e;
}

.doc-card__badge--uploaded {
  background: rgba(220, 38, 38, 0.15);
  color: var(--color-accent);
}

.doc-card__hint {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  color: var(--color-muted);
}

.doc-card__file {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
}

.doc-card__filename {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-card__meta {
  color: var(--color-muted);
}

.doc-dropzone {
  border: 2px dashed rgba(15, 23, 42, 0.15);
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s, background 0.2s;
  min-height: 88px;
}

.doc-dropzone:hover:not(.doc-dropzone--disabled),
.doc-dropzone.is-dragover {
  border-color: var(--color-primary);
  background: rgba(11, 61, 110, 0.03);
}

.doc-dropzone--disabled {
  opacity: 1;
  cursor: not-allowed;
  background: #1a1a1a;
  border-color: #cbd2dc;
}

.doc-dropzone--disabled .doc-dropzone__text {
  color: #64748b;
}

.doc-dropzone__input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.doc-dropzone--disabled .doc-dropzone__input {
  pointer-events: none;
}

.doc-dropzone__icon {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 0.25rem;
}

.doc-dropzone__text {
  margin: 0;
  font-size: 0.8rem;
  color: var(--color-muted);
}

.doc-dropzone__link {
  color: var(--color-primary);
  text-decoration: underline;
}

.doc-preview {
  padding: 0.5rem 0;
}

.doc-preview__img {
  max-width: 100%;
  max-height: 120px;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  object-fit: contain;
}

.doc-preview__name {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  word-break: break-all;
}

.doc-preview__actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.doc-progress {
  padding: 0.5rem 0;
}

.doc-progress__bar {
  height: 6px;
  background: rgba(15, 23, 42, 0.1);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}

.doc-progress__fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--color-primary);
  border-radius: 999px;
  transition: width 0.15s linear;
}

.doc-progress__pct {
  font-size: 0.75rem;
  color: var(--color-muted);
}

.portal-submit-wrap {
  text-align: center;
  padding: 1rem 0 2rem;
}

.btn--block {
  width: 100%;
}

.btn--lg {
  padding: 0.875rem 2rem;
  font-size: 1rem;
}

/* Admin */
.portal-admin-body {
  background: #1a1a1a;
}

.portal-admin-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.portal-table-wrap {
  overflow-x: auto;
  background: var(--color-surface);
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.portal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.portal-table th,
.portal-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.portal-table th {
  background: #121212;
  font-weight: 600;
}

.portal-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  align-items: flex-end;
}

.portal-filters .form__input,
.portal-filters select {
  min-width: 140px;
}

.status-pill {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-pill--submitted {
  background: rgba(220, 38, 38, 0.15);
  color: var(--color-accent);
}

.status-pill--uploading {
  background: rgba(220, 38, 38, 0.1);
  color: var(--color-accent);
}

.status-pill--registered {
  background: rgba(248, 113, 113, 0.15);
  color: #92400e;
}

.portal-doc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.portal-doc-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  flex-wrap: wrap;
}
