@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");

:root {
  --primary: #4361ee;
  --primary-dark: #3a56d4;
  --primary-light: #4895ef;
  --secondary: #6c757d;
  --success: #2ec4b6;
  --danger: #e63946;
  --dark: #2b2d42;
  --light: #f8f9fa;
  --bg-body: #f0f2f5;
  --card-bg: #ffffff;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  --header-height: 70px;
}

/* KEAMANAN: ANTI SELECT & COPY PASTE */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
input,
textarea {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
  -webkit-touch-callout: default !important;
  cursor: text;
}

body {
  background-color: var(--bg-body);
  color: var(--dark);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-size: 0.95rem;
  overflow-x: hidden;
}

/* HEADER */
.header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 0 5%;
  height: var(--header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}
.header h1 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-logo {
  height: 35px;
  width: auto;
  object-fit: contain;
  pointer-events: none;
}
#timer {
  background: #fff0f0;
  color: var(--danger);
  padding: 6px 15px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  border: 1px solid #ffd6d6;
  box-shadow: 0 2px 5px rgba(230, 57, 70, 0.1);
  font-family: monospace;
}

/* CONTAINER & LOGIN */
.main-container {
  width: 100%;
  max-width: 850px;
  margin: 2rem auto;
  padding: 0 15px;
  flex: 1;
}
.login-container,
.token-container {
  background: var(--card-bg);
  padding: 3rem 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 400px;
  text-align: center;
  margin: 4rem auto;
  border: 1px solid rgba(0, 0, 0, 0.02);
}
.login-logo {
  width: 100px;
  margin-bottom: 1.5rem;
  object-fit: contain;
  pointer-events: none;
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.login-container h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 5px;
}
.token-container input {
  font-size: 2rem;
  letter-spacing: 5px;
  text-align: center;
  font-weight: 700;
  text-transform: uppercase;
  border: 2px solid #eee;
  background: #fafafa;
  height: 60px;
  border-radius: var(--radius);
  width: 100%;
  margin-bottom: 1rem;
  transition: 0.3s;
}
.token-container input:focus {
  border-color: var(--primary);
  background: #fff;
  outline: none;
}

/* FORM & CARD */
.form-group {
  margin-bottom: 1.2rem;
  text-align: left;
}
.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}
.form-group input {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  font-size: 0.95rem;
  transition: 0.3s;
}
.form-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.1);
  outline: none;
}
.btn {
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 10px rgba(67, 97, 238, 0.2);
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}
.btn-logout {
  background: #fff;
  color: var(--danger);
  border: 1px solid #ffe5e5;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  border-radius: 50px;
  text-decoration: none;
  transition: 0.2s;
}
.btn-logout:hover {
  background: var(--danger);
  color: #fff;
}
.alert {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  text-align: left;
}
.alert-danger {
  background-color: #fff5f5;
  color: #c62828;
  border: 1px solid #ffcdd2;
}
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: none;
  box-shadow: var(--shadow);
  padding: 2.5rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: visible;
}
.card-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed #eee;
}
.card-header h2 {
  font-size: 1.25rem;
  color: var(--dark);
  margin: 0;
}

/* SOAL */
.soal-container {
  margin-bottom: 3rem;
}
.soal-container-es {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px dashed #eee;
}
.pertanyaan {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  line-height: 1.7;
  color: #1a1a1a;
}
.nomor {
  background: var(--primary);
  color: #fff;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.9rem;
  margin-right: 8px;
  font-weight: 600;
}
.soal-gambar {
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid #eee;
  margin: 10px 0 20px 0;
  pointer-events: none;
}
.opsi-grup {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.opsi-label {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border: 2px solid #f0f0f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fff;
  position: relative;
}
.opsi-label:hover {
  background: #f8f9fa;
  border-color: #d0d0d0;
}
.opsi-label input {
  margin-right: 15px;
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}
.opsi-label:has(input:checked) {
  border-color: var(--primary);
  background-color: #f0f4ff;
  color: var(--primary);
  font-weight: 600;
}
textarea {
  width: 100%;
  border: 2px solid #f0f0f0;
  border-radius: var(--radius);
  padding: 1rem;
  min-height: 150px;
  font-family: inherit;
  font-size: 1rem;
  background: #fcfcfc;
  transition: 0.3s;
  resize: vertical;
  line-height: 1.5;
}
textarea:focus {
  background: #fff;
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 10px rgba(67, 97, 238, 0.1);
}
.separator {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  margin: 3rem 0;
  border-top: 2px dashed #e0e0e0;
  padding-top: 1.5rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}
form {
  padding-bottom: 80px;
}

/* MODAL & OVERLAY */
#save-status {
  display: none !important; /* Hilang agar tidak mengganggu */
}
#loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.98);
  z-index: 99999;
  text-align: center;
  padding-top: 40vh;
}
.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #eee;
  border-top: 5px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px auto;
}
@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 100000;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(8px);
}
.modal-box {
  background: #fff;
  width: 90%;
  max-width: 380px;
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: bounceIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
}
.modal-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  display: block;
}
.modal-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: #343a40;
}
.modal-text {
  color: #666;
  margin-bottom: 2rem;
  line-height: 1.5;
  font-size: 0.9rem;
}
.modal-btn {
  border-radius: 50px;
  padding: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: transform 0.1s;
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  width: 100%;
  display: block;
}
.modal-btn:active {
  transform: scale(0.95);
}
.type-warning .modal-icon {
  color: #fcc419;
}
.type-warning .modal-btn {
  background: #fcc419;
  color: #000;
}
.type-danger .modal-icon {
  color: #e03131;
}
.type-danger .modal-btn {
  background: #e03131;
  color: #fff;
}
@keyframes bounceIn {
  from {
    transform: scale(0.5);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
.app-footer {
  text-align: center;
  padding: 2rem;
  color: #adb5bd;
  font-size: 0.85rem;
  background: #fff;
  margin-top: auto;
  border-top: 1px solid #f1f1f1;
}
.padiweb-logo-footer {
  height: 20px;
  opacity: 0.5;
  vertical-align: middle;
  margin-left: 5px;
  pointer-events: none;
}

/* BLOCKER LANDSCAPE */
#landscape-blocker {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #2b2d42;
  color: #fff;
  z-index: 999999;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px;
}
.rotate-icon {
  font-size: 3rem;
  margin-bottom: 15px;
  animation: rotateAnim 2s infinite;
}
@keyframes rotateAnim {
  0% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-90deg);
  }
  50% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(0deg);
  }
}
.btn-recheck {
  margin-top: 30px;
  padding: 12px 30px;
  background: #28a745;
  color: white;
  border: 2px solid #fff;
  border-radius: 50px;
  font-weight: bold;
  cursor: pointer;
  font-size: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .header {
    padding: 0.8rem 1rem;
  }
  .card {
    padding: 1.5rem;
  }
  .opsi-label {
    padding: 10px;
    font-size: 0.95rem;
  }
}
