body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
    text-align: center;
}

.container {
    max-width: 600px;
    margin: 50px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    text-align: left;
}

h2 {
    color: #007BFF;
    border-bottom: 2px solid #007BFF;
    padding-bottom: 5px;
    margin-bottom: 15px;
}

label {
    font-weight: bold;
    display: block;
    margin-top: 15px;
}

select,
input {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}

button {
    display: block;
    width: 100%;
    padding: 12px;
    margin-top: 20px;
    font-size: 16px;
    color: #fff;
    background-color: #007BFF;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.3s ease-in-out;
}

button:hover {
    background-color: #0056b3;
}

#certificate-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

#certificate-actions button {
    width: auto;
    padding: 10px 15px;
}

/* only hide on the generator page */
.page-generator #certificate-content { display: none; }

#certificate-content pre {
  white-space: pre-wrap;
  word-break: break-word;
}

.actions-row {
  display: flex;
  justify-content: center; /* horizontal */
  align-items: center;     /* vertical */
}


#certificate-content {
    margin-top: 20px;
    background: #eee;
    padding: 15px;
    border-radius: 5px;
    display: none;
}

.nav {
    background: #007BFF;
    padding: 10px 0;
    text-align: center;
}

.nav a {
    color: white;
    text-decoration: none;
    margin: 0 15px;
    font-size: 18px;
}

.nav a:hover {
    text-decoration: underline;
}

.cn-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    /* Space between rows */
}

.iot-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    /* Space between rows */
}

.cn-option {
    display: flex;
    align-items: center;
    /* Align checkbox, label, and input */
    gap: 10px;
    /* Space between elements */
    padding: 5px;
}

.iot-option {
    display: flex;
    align-items: center;
    /* Align checkbox, label, and input */
    gap: 10px;
    /* Space between elements */
    padding: 5px;
}

.cn-option input[type="checkbox"] {
    width: 15px;
    /* Set fixed width for checkbox */
    height: 15px;
    margin-right: 5px;
}

.cn-option label {
    font-size: 16px;
    font-weight: bold;
    min-width: 90px;
    /* Ensures consistent spacing */
}

.cn-option input[type="text"] {
    flex-grow: 1;
    /* Makes input field take available space */
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    display: none;
    /* Hidden by default */
}
.error-message {
color: red;
font-size: 12px;
margin-left: 10px;
}

a.button {
    display: block;
    width: 100%;
    padding: 12px;
    margin-top: 20px;
    text-align: center;
    font-size: 16px;
    color: #ffffff;
    background-color: green;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.3s ease-in-out;
}
a.button:hover {
    background-color: #00b38f;
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px; /* Optional: adds space below the header row */
}

.header-row h2 {
  margin: 0;
}

.back-link {
  text-decoration: none;
  font-size: 0.9em;
  color: #007BFF; /* Optional: sets link color */
}

.back-link:hover {
  text-decoration: underline;
}

#loader {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(255, 255, 255, 0.8);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

#loader::after {
  content: "";
  width: 50px;
  height: 50px;
  border: 6px solid #ccc;
  border-top-color: #333;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
.loading {
  position: fixed; inset: 0;
  display: none; /* toggled via JS */
  align-items: center; justify-content: center;
  background: rgba(255,255,255,0.6);
  z-index: 9999;
}
.spinner {
  width: 48px; height: 48px;
  border: 6px solid #ccc; border-top-color: #333;
  border-radius: 50%; animation: spin 1s linear infinite;
  margin-right: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }
