:root {
  --radius: 20px;
  --shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  --bg-light: #f5f7fa;
  --bg-white: #ffffff;
  --primary: #007bff;
  --accent: #0056d2;
  --text-dark: #333;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-light);
  color: var(--text-dark);
}

nav.tabs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--bg-white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.tab {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: var(--radius);
  background-color: var(--primary);
  color: white;
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  transition: 0.3s ease;
}

.tab.active,
.tab:hover {
  background-color: var(--accent);
}

.container {
  display: flex;
  gap: 2rem;
  padding: 2rem;
  max-width: 1200px;
  width: 100%;
  margin: auto;
  box-sizing: border-box;
}

.form-column {
  flex: 1;
}

.preview-column {
  flex: 2;
  background: white;
  padding: 2rem;
  box-shadow: var(--shadow);
  font-family: 'Times New Roman', serif;
  font-size: 16px;
  border-radius: 12px;
  animation: fadeIn 1s ease-in-out;
  white-space: normal;
  word-break: break-word;
}

.to-right {
  text-align: right;
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin-bottom: 2rem;
}

.to-right p {
  text-align: left;
  width: 250px;
}

.centered {
  text-align: center;
  font-weight: bold;
  text-decoration: underline;
}

.form-column form {
  background-color: var(--bg-white);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

input,
select,
button {
  font-size: 1rem;
  padding: 0.8rem;
  border: 1px solid #ccc;
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.3s ease;
}

input:focus,
select:focus {
  border-color: var(--primary);
}

button[type="submit"] {
  background-color: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  transition: 0.3s ease;
}

button[type="submit"]:hover {
  background-color: var(--accent);
}

.hidden {
  display: none;
}

.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #4caf50;
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 9999;
}

.toast.show {
  opacity: 1;
  pointer-events: auto;
}

.toast.error {
  background-color: #f44336;
}

#check {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1rem;
  width: 100%;
  box-sizing: border-box;
}

#checkForm {
  display: flex;
  gap: 0.5rem;
  max-width: 800px;
  width: 100%;
  justify-content: center;
  margin-bottom: 2rem;
}

#checkForm input {
  flex: 1;
  font-size: 1rem;
  padding: 0.8rem;
  border-radius: var(--radius);
  border: 1px solid #ccc;
}

#checkForm button {
  padding: 0.8rem 1.2rem;
  font-size: 1rem;
  border-radius: var(--radius);
  background-color: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  transition: 0.3s ease;
}

#checkForm button:hover {
  background-color: var(--accent);
}

#statusResult {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem;
  box-sizing: border-box;
}

.status-result {
  background-color: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 2rem;
  font-size: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  width: 100%;
  max-width: 700px;
  box-sizing: border-box;
}

.status-ok {
  background-color: #a0ffa8;
}

.status-pending {
  background-color: #fff8e1;
}

.status-rejected {
  background-color: #ff93a4;
}

.status-result span {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  line-height: 1.4;
}

@media (max-width: 768px) {
  .container {
    flex-direction: column;
    padding: 1rem;
  }

  .form-column,
  .preview-column {
    width: 100%;
    padding: 1rem;
  }

  .preview-column {
    font-size: 15px;
    box-shadow: none;
    border-radius: 8px;
  }

  .tab {
    flex: 1;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
  }

  nav.tabs {
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
  }

  #checkForm {
    flex-direction: column;
    align-items: stretch;
  }

  #checkForm input,
  #checkForm button {
    width: 100%;
  }

  #check {
    padding: 1.5rem 1rem;
  }

  #statusResult {
    max-width: 100%;
  }

  .status-result {
    font-size: 0.95rem;
  }
}

.tab-content.hidden {
  display: none !important;
}

.print-button {
  display: block;
  margin-bottom: 1rem;
  background-color: #007bff;
  color: white;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.print-button:hover {
  background-color: #0056b3;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
