/* =============================================
   MI Al Wathoniyah 51 - PPDB Stylesheet
   ============================================= */

:root {
  --primary: #269ae8;
  --primary-dark: #2888dd;
  --primary-light: #e8f5ee;
  --accent: #e0b351;
  --accent-dark: #c99a3a;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;
  --info: #3b82f6;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --radius: 12px;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
  --transition: all 0.3s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  font-size: 0.95rem;
}

/* ====== TYPOGRAPHY ====== */
h1,
h2,
h3,
h4 {
  font-weight: 700;
  line-height: 1.3;
  color: var(--gray-900);
}
h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}
h2 {
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
}
h3 {
  font-size: clamp(1rem, 2vw, 1.25rem);
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  color: var(--primary-dark);
}

/* ====== LAYOUT ====== */
.ppdb-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container--sm {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container--md {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ====== TOPBAR ====== */
.ppdb-topbar {
  background: var(--primary);
  color: white;
  padding: 0.6rem 0;
  font-size: 0.82rem;
}

.ppdb-topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.ppdb-topbar a {
  color: rgba(255, 255, 255, 0.85);
}
.ppdb-topbar a:hover {
  color: white;
}

/* ====== HEADER ====== */
.ppdb-header {
  background: white;
  border-bottom: 2px solid var(--primary-light);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.ppdb-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.ppdb-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.ppdb-brand-logo {
  width: 48px;
  height: 48px;
  background: var(--primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.ppdb-brand-text strong {
  display: block;
  color: var(--primary);
  font-size: 1rem;
  line-height: 1.2;
}

.ppdb-brand-text small {
  color: var(--gray-500);
  font-size: 0.78rem;
}

.ppdb-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ppdb-nav a,
.ppdb-nav button {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.ppdb-nav a.nav-link {
  color: var(--gray-600);
  background: transparent;
}

.ppdb-nav a.nav-link:hover {
  background: var(--gray-100);
  color: var(--primary);
}

/* ====== BUTTONS ====== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
  text-decoration: none;
  font-family: inherit;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.btn--primary:hover:not(:disabled) {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(30, 127, 89, 0.3);
}

.btn--accent {
  background: var(--accent);
  color: var(--gray-900);
  border-color: var(--accent);
}
.btn--accent:hover:not(:disabled) {
  background: var(--accent-dark);
  transform: translateY(-2px);
}

.btn--outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn--outline:hover:not(:disabled) {
  background: var(--primary-light);
}

.btn--ghost {
  background: var(--gray-100);
  color: var(--gray-700);
  border-color: transparent;
}
.btn--ghost:hover:not(:disabled) {
  background: var(--gray-200);
}

.btn--danger {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.btn--sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem;
  border-radius: 8px;
}
.btn--lg {
  padding: 0.9rem 2rem;
  font-size: 1rem;
}
.btn--full {
  width: 100%;
}

.btn .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}
.btn.loading .spinner {
  display: block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ====== FORMS ====== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 600;
  color: var(--gray-700);
  font-size: 0.9rem;
}

.form-group label .req {
  color: var(--danger);
  margin-left: 3px;
}

.form-control {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 2px solid var(--gray-200);
  border-radius: 10px;
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--gray-800);
  background: white;
  transition: var(--transition);
  appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(30, 127, 89, 0.1);
}

.form-control.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.form-control::placeholder {
  color: var(--gray-400);
}

select.form-control {
  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 d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

.form-help {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-top: 4px;
}
.form-error {
  font-size: 0.82rem;
  color: var(--danger);
  margin-top: 4px;
  display: none;
}
.form-error.show {
  display: block;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-row--3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.radio-group,
.checkbox-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.radio-item,
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.radio-item input,
.checkbox-item input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ====== CARDS ====== */
.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.card-header h3 {
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1rem 1.5rem;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-100);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

/* ====== BADGES / STATUS ====== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.badge--menunggu {
  background: #fef3c7;
  color: #92400e;
}
.badge--diterima {
  background: #d1fae5;
  color: #065f46;
}
.badge--ditolak {
  background: #fee2e2;
  color: #991b1b;
}
.badge--wawancara {
  background: #dbeafe;
  color: #1e40af;
}

/* ====== ALERTS ====== */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.alert i {
  margin-top: 2px;
  flex-shrink: 0;
}

.alert--success {
  background: #d1fae5;
  color: #065f46;
  border-left: 4px solid var(--success);
}
.alert--error {
  background: #fee2e2;
  color: #991b1b;
  border-left: 4px solid var(--danger);
}
.alert--warning {
  background: #fef3c7;
  color: #92400e;
  border-left: 4px solid var(--warning);
}
.alert--info {
  background: #dbeafe;
  color: #1e40af;
  border-left: 4px solid var(--info);
}

/* ====== STEPS / WIZARD ====== */
.steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 2.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.step {
  display: flex;
  align-items: center;
  flex: 1;
}

.step-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
  background: var(--gray-200);
  color: var(--gray-500);
  transition: var(--transition);
  border: 2px solid var(--gray-200);
}

.step.active .step-icon {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(30, 127, 89, 0.15);
}

.step.done .step-icon {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.step-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray-400);
  margin-top: 0.4rem;
  text-align: center;
  white-space: nowrap;
}

.step.active .step-label {
  color: var(--primary);
}
.step.done .step-label {
  color: var(--success);
}

.step-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.step-connector {
  flex: 1;
  height: 2px;
  background: var(--gray-200);
  min-width: 24px;
}

.step.done + .step .step-connector,
.step.done ~ .step .step-connector {
  background: var(--success);
}

/* ====== SECTION SEPARATOR ====== */
.section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--primary-light);
}

.section-title i {
  width: 36px;
  height: 36px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.section-title h3 {
  font-size: 1rem;
  color: var(--primary-dark);
}

/* ====== TABLE ====== */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  font-size: 0.88rem;
}

table thead th {
  background: var(--gray-800);
  color: white;
  padding: 0.85rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

table tbody tr {
  border-bottom: 1px solid var(--gray-100);
  transition: var(--transition);
}

table tbody tr:hover {
  background: var(--gray-50);
}

table td {
  padding: 0.9rem 1rem;
  color: var(--gray-700);
  vertical-align: middle;
}

/* ====== STATS GRID ====== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 1rem;
  border-left: 4px solid var(--primary);
}

.stat-card.accent {
  border-left-color: var(--accent);
}
.stat-card.success {
  border-left-color: var(--success);
}
.stat-card.danger {
  border-left-color: var(--danger);
}
.stat-card.info {
  border-left-color: var(--info);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  background: var(--primary-light);
  color: var(--primary);
}

.stat-card.accent .stat-icon {
  background: #fef3c7;
  color: #92400e;
}
.stat-card.success .stat-icon {
  background: #d1fae5;
  color: #2c43da;
}
.stat-card.danger .stat-icon {
  background: #fee2e2;
  color: #991b1b;
}
.stat-card.info .stat-icon {
  background: #dbeafe;
  color: #1e40af;
}

.stat-value {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-top: 3px;
}

/* ====== DASHBOARD ====== */
.dashboard-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 130px);
  gap: 0;
}

.dashboard-sidebar {
  background: white;
  border-right: 1px solid var(--gray-200);
  padding: 1.5rem 1rem;
}

.sidebar-nav {
  list-style: none;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  color: var(--gray-600);
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition);
  margin-bottom: 0.25rem;
}

.sidebar-nav a:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.sidebar-nav a.active {
  background: var(--primary);
  color: white;
}

.sidebar-nav a i {
  width: 20px;
  text-align: center;
}

.dashboard-main {
  padding: 2rem;
  background: var(--gray-50);
}

/* ====== HERO PPDB ====== */
.ppdb-hero {
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    #124189 50%,
    #2d77de 100%
  );
  color: white;
  padding: 4rem 0 3rem;
  position: relative;
  overflow: hidden;
}

.ppdb-hero::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
}

.ppdb-hero::after {
  content: "";
  position: absolute;
  bottom: -30%;
  left: -5%;
  width: 300px;
  height: 300px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
}

.ppdb-hero .container {
  position: relative;
  z-index: 1;
}

.ppdb-hero h1 {
  color: white;
  margin-bottom: 0.75rem;
}
.ppdb-hero p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.05rem;
}

.ppdb-hero-badges {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.ppdb-hero-badge {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ====== UPLOAD AREA ====== */
.upload-area {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--gray-50);
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-area input[type="file"] {
  display: none;
}

.upload-area i {
  font-size: 2rem;
  color: var(--gray-400);
  margin-bottom: 0.5rem;
}

.upload-area p {
  font-size: 0.88rem;
  color: var(--gray-500);
}

.upload-area .upload-label {
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
}

.file-preview {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--primary-light);
  border-radius: 8px;
  margin-top: 0.75rem;
  display: none;
}

.file-preview.show {
  display: flex;
}

/* ====== PRINT STYLES ====== */
@media print {
  .ppdb-header,
  .ppdb-topbar,
  .ppdb-nav,
  .btn,
  .dashboard-sidebar {
    display: none !important;
  }
  .dashboard-main {
    padding: 0;
    background: white;
  }
  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
  .form-row,
  .form-row--3 {
    grid-template-columns: 1fr;
  }
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
  .dashboard-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--gray-200);
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .ppdb-header .container {
    flex-wrap: wrap;
  }
  .ppdb-nav {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .card-body {
    padding: 1rem;
  }
}
