:root {
  --primary-red: #CE1126; /* BNI Red */
  --primary-dark: #a30d1e;
  --white: #ffffff;
  --bg-gray: #f4f4f4;
  --text-dark: #333333;
  --text-gray: #666666;
  --border-color: #dddddd;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Sarabun', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-gray);
  color: var(--text-dark);
  line-height: 1.6;
  padding-bottom: 40px;
}

/* Header */
header {
  background-color: var(--primary-red);
  color: var(--white);
  padding: 1rem;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  position: relative;
}

header h1 {
  font-size: 1.5rem;
  margin: 0;
  font-weight: 600;
}

.admin-btn {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(255, 255, 255, 0.2);
  color: var(--white);
  text-decoration: none;
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: background 0.3s;
}

.admin-btn:hover {
  background-color: rgba(255, 255, 255, 0.4);
}

/* Main Container */
.main {
  max-width: 600px;
  margin: 20px auto;
  padding: 0 15px;
  animation: fadeIn 0.8s ease-out;
}

/* Card */
.card {
  background: var(--white);
  border-radius: 12px;
  padding: 25px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  border-top: 5px solid var(--primary-red);
}

h2 {
  color: var(--primary-red);
  margin-bottom: 10px;
  font-size: 1.4rem;
  border-bottom: 1px solid var(--bg-gray);
  padding-bottom: 10px;
}

h3 {
  font-size: 1.1rem;
  margin-bottom: 15px;
  color: var(--text-dark);
}

p.small, .small {
  font-size: 0.9rem;
  color: var(--text-gray);
  margin-bottom: 15px;
}

/* Form Elements */
.form-row {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-dark);
}

select, input[type="text"], input[type="file"] {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  background-color: #fff;
  transition: border-color 0.3s, box-shadow 0.3s;
}

select:focus, input:focus {
  outline: none;
  border-color: var(--primary-red);
  box-shadow: 0 0 0 3px rgba(206, 17, 38, 0.1);
}

select:disabled {
  background-color: #f9f9f9;
  color: #aaa;
  cursor: not-allowed;
}

/* Bank Info Box */
.bank-info {
  background-color: #fdf2f2; /* Light red bg */
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  text-align: center;
}

.bank-info strong {
  color: var(--primary-red);
  display: block;
  margin: 5px 0;
  font-size: 1.1rem;
}

button[type="button"] {
  background-color: var(--white);
  border: 1px solid var(--primary-red);
  color: var(--primary-red);
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  margin-top: 5px;
  transition: all 0.3s;
}

button[type="button"]:hover {
  background-color: var(--primary-red);
  color: var(--white);
}

/* Submit Button */
button[type="submit"] {
  width: 100%;
  background-color: var(--primary-red);
  color: var(--white);
  border: none;
  padding: 15px;
  font-size: 1.1rem;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
  box-shadow: 0 4px 6px rgba(206, 17, 38, 0.3);
}

button[type="submit"]:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
}

button[type="submit"]:active {
  transform: translateY(0);
}

/* Loading Overlay */
#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

#loading-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid var(--primary-red);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

.loading-text {
  font-size: 1.2rem;
  color: var(--primary-red);
  font-weight: bold;
}

/* Animations */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Steps Animation */
.steps-container {
  display: flex;
  justify-content: space-between;
  margin-bottom: 25px;
  flex-wrap: wrap;
  gap: 10px;
}

.step-item {
  flex: 1;
  min-width: 120px;
  background-color: #ffffff;
  border: 2px solid #28a745; /* Green border */
  color: #28a745;
  border-radius: 8px;
  padding: 15px 10px;
  text-align: center;
  position: relative;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.5s forwards;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: transform 0.3s, background-color 0.3s, color 0.3s;
}

.step-item:hover {
  transform: translateY(-5px);
  background-color: #28a745;
  color: #ffffff;
}

.step-item.completed {
  background-color: #28a745;
  color: #ffffff;
  border-color: #28a745;
}

.step-item:nth-child(1) { animation-delay: 0.1s; }
.step-item:nth-child(2) { animation-delay: 0.3s; }
.step-item:nth-child(3) { animation-delay: 0.5s; }
.step-item:nth-child(4) { animation-delay: 0.7s; }

.step-number {
  display: block;
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 5px;
}

.step-text {
  font-size: 0.9rem;
  line-height: 1.2;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 600px) {
  header {
    padding: 1rem 0.5rem;
  }

  header h1 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem; /* Add space for buttons below if they wrap */
  }
  
  /* Adjust header buttons for mobile */
  header div[style*="absolute"] {
    position: static !important;
    transform: none !important;
    justify-content: center;
    margin-top: 5px;
  }

  .admin-btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  .main {
    margin: 10px auto;
    padding: 0 10px;
  }
  
  .card {
    padding: 15px;
    border-radius: 8px;
  }
  
  h2 {
    font-size: 1.2rem;
  }

  /* Make inputs and buttons easier to tap */
  input[type="text"],
  input[type="file"],
  select,
  button {
    font-size: 16px; /* Prevents iOS zoom on focus */
    padding: 12px;
    height: auto;
  }

  button {
    width: 100%; /* Full width buttons on mobile */
    margin-top: 10px;
  }

  /* Responsive Tables */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  table {
    font-size: 0.85rem;
    min-width: 100%;
  }
  
  th, td {
    padding: 6px;
  }
}
