/* ============================================================
   GLOBAL STYLE — Tema Merah Maroon
   ============================================================ */

:root {
  --maroon-dark:   #4a0e0e;
  --maroon:        #7b1e1e;
  --maroon-light:  #a83232;
  --maroon-soft:   #c94c4c;
  --gold:          #d4a017;
  --cream:         #fdf6f0;
  --text-dark:     #2b1a1a;
  --text-muted:    #7a6a6a;
  --white:         #ffffff;
  --shadow-sm:     0 2px 8px rgba(74, 14, 14, 0.08);
  --shadow-md:     0 8px 24px rgba(74, 14, 14, 0.15);
  --shadow-lg:     0 16px 48px rgba(74, 14, 14, 0.25);
  --radius-sm:     8px;
  --radius-md:     14px;
  --radius-lg:     20px;
  --transition:    all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  font-family: 'Segoe UI', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--cream);
  color: var(--text-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   AUTH PAGE (Register & Login)
   ============================================================ */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 10% 20%, rgba(123, 30, 30, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(212, 160, 23, 0.08) 0%, transparent 40%),
    linear-gradient(135deg, #fdf6f0 0%, #f5e6e0 100%);
  position: relative;
  overflow: hidden;
}

/* Ornamen background */
.auth-page::before,
.auth-page::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  pointer-events: none;
}

.auth-page::before {
  width: 400px;
  height: 400px;
  background: var(--maroon-light);
  top: -150px;
  left: -150px;
}

.auth-page::after {
  width: 350px;
  height: 350px;
  background: var(--gold);
  bottom: -120px;
  right: -120px;
}

/* ============================================================
   AUTH CARD
   ============================================================ */

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header dengan aksen maroon */
.auth-header {
  background: linear-gradient(135deg, var(--maroon-dark) 0%, var(--maroon) 50%, var(--maroon-light) 100%);
  padding: 36px 32px 28px;
  text-align: center;
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.auth-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: rgba(212, 160, 23, 0.15);
  border-radius: 50%;
}

.auth-header::after {
  content: '';
  position: absolute;
  bottom: -60%;
  left: -10%;
  width: 180px;
  height: 180px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
}

.auth-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  backdrop-filter: blur(10px);
}

.auth-logo svg {
  width: 38px;
  height: 38px;
  fill: var(--white);
}

.auth-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.3px;
  position: relative;
  z-index: 1;
  margin-bottom: 4px;
}

.auth-subtitle {
  font-size: 13px;
  opacity: 0.85;
  position: relative;
  z-index: 1;
  font-weight: 400;
}

/* Body form */
.auth-body {
  padding: 32px;
}

/* Alert */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.5;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.alert-danger {
  background: #fdeaea;
  color: #8b1a1a;
  border-left: 4px solid var(--maroon);
}

.alert-success {
  background: #eaf6ea;
  color: #1e5e1e;
  border-left: 4px solid #2e7d32;
}

.alert-warning {
  background: #fff8e6;
  color: #7a5a00;
  border-left: 4px solid var(--gold);
}

.alert-icon {
  flex-shrink: 0;
  font-weight: 700;
}

/* Form group */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 7px;
  letter-spacing: 0.2px;
}

.form-label .required {
  color: var(--maroon-light);
  margin-left: 2px;
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--text-dark);
  background: #fafafa;
  border: 1.5px solid #e8dede;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  background: var(--white);
  border-color: var(--maroon);
  box-shadow: 0 0 0 4px rgba(123, 30, 30, 0.1);
}

.form-control::placeholder {
  color: #b8a8a8;
}

/* Input dengan icon */
.input-wrapper {
  position: relative;
}

.input-wrapper .form-control {
  padding-left: 42px;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  fill: var(--text-muted);
  pointer-events: none;
  transition: var(--transition);
}

.input-wrapper .form-control:focus + .input-icon {
  fill: var(--maroon);
}

/* Toggle password */
.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: var(--transition);
}

.toggle-password:hover {
  background: rgba(123, 30, 30, 0.08);
}

.toggle-password svg {
  width: 18px;
  height: 18px;
  fill: var(--text-muted);
}

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.3px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--maroon) 0%, var(--maroon-light) 100%);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(123, 30, 30, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--maroon-dark) 0%, var(--maroon) 100%);
  box-shadow: 0 6px 20px rgba(123, 30, 30, 0.4);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Footer */
.auth-footer {
  padding: 0 32px 28px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--maroon);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}

.auth-footer a:hover {
  color: var(--maroon-dark);
  text-decoration: underline;
}

/* Info box */
.info-box {
  background: linear-gradient(135deg, #fdf6f0 0%, #f9ece4 100%);
  border: 1px solid #f0dcd0;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 22px;
  line-height: 1.6;
}

.info-box strong {
  color: var(--maroon);
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--text-muted);
  font-size: 12px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e8dede;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 480px) {
  .auth-page {
    padding: 16px;
  }

  .auth-card {
    border-radius: var(--radius-md);
  }

  .auth-header {
    padding: 28px 20px 22px;
  }

  .auth-body {
    padding: 24px 20px;
  }

  .auth-footer {
    padding: 0 20px 22px;
  }

  .auth-title {
    font-size: 19px;
  }

  .form-control {
    font-size: 16px; /* hindari zoom di iOS */
  }
}

/* ============================================================
   SCAN PAGE (Halaman Depan)
   ============================================================ */

.scan-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, var(--maroon-dark) 0%, var(--maroon) 100%);
  color: var(--white);
}

.scan-header {
  padding: 20px 24px;
  text-align: center;
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.scan-header h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.scan-header p {
  font-size: 12.5px;
  opacity: 0.8;
  margin-top: 2px;
}

.scan-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  text-align: center;
}

.scan-icon {
  width: 100px;
  height: 100px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.3); }
  50%      { transform: scale(1.05); box-shadow: 0 0 0 20px rgba(255, 255, 255, 0); }
}

.scan-icon svg {
  width: 48px;
  height: 48px;
  fill: var(--white);
}

.scan-main h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.scan-main p {
  font-size: 14.5px;
  opacity: 0.85;
  max-width: 400px;
  margin-bottom: 32px;
  line-height: 1.6;
}

.btn-scan {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 40px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.5px;
  color: var(--maroon);
  background: var(--white);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  text-decoration: none;
}

.btn-scan:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  background: var(--cream);
}

.btn-scan svg {
  width: 22px;
  height: 22px;
  fill: var(--maroon);
}

.scan-footer {
  padding: 16px;
  text-align: center;
  font-size: 11.5px;
  opacity: 0.6;
}