* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Login screen */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 2.5rem;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.login-card h1 {
  margin-bottom: 0.5rem;
}

.login-card p {
  margin-bottom: 1.5rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: left;
}

.login-field label {
  display: block;
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 0.3rem;
}

.login-field input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
}

.login-field input:focus {
  outline: none;
  border-color: #4a90d9;
  box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.2);
}

.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 2.5rem;
}

.password-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  width: auto;
  flex: none;
}

.password-toggle:hover svg {
  stroke: #4a90d9;
}

.login-btn {
  padding: 0.75rem 1.5rem;
  background: #4a90d9;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
  width: 100%;
  margin-top: 0.25rem;
}

.login-btn:hover {
  background: #357abd;
}

.login-error {
  margin-top: 1rem;
  color: #c62828;
  font-size: 0.85rem;
}

/* Header con logout */
.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.main-header h1 {
  margin-bottom: 0;
}

.logout-btn {
  padding: 0.4rem 0.8rem;
  background: transparent;
  color: #888;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  flex: none;
}

.logout-btn:hover {
  background: #f5f5f5;
  color: #333;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f5f5;
  color: #333;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

main {
  background: #fff;
  border-radius: 12px;
  padding: 2.5rem;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

p {
  color: #666;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.drop-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 2rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-align: center;
  color: #888;
}

.drop-zone:hover,
.drop-zone--over {
  border-color: #4a90d9;
  background: #f0f6ff;
}

.file-info {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: #555;
}

.course-fields {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.course-field label {
  display: block;
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 0.3rem;
}

.course-field input,
.course-field select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9rem;
  background: #fff;
}

.course-field input:focus,
.course-field select:focus {
  outline: none;
  border-color: #4a90d9;
  box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.2);
}

.button-group {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

button {
  flex: 1;
  padding: 0.75rem;
  background: #4a90d9;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover:not(:disabled) {
  background: #357abd;
}

button:disabled {
  background: #b0c4de;
  cursor: not-allowed;
}

.status {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.status--ok {
  background: #e8f5e9;
  color: #2e7d32;
}

.status--error {
  background: #fbe9e7;
  color: #c62828;
}

#previewBtn {
  background: #6c757d;
}

#previewBtn:hover:not(:disabled) {
  background: #545b62;
}

#editBtn {
  background: #e67e22;
}

#editBtn:hover:not(:disabled) {
  background: #d35400;
}

.headings-preview {
  margin-top: 1rem;
  padding: 1rem;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  font-size: 0.85rem;
  max-height: 300px;
  overflow-y: auto;
}

.headings-preview ul {
  list-style: none;
  margin-top: 0.5rem;
}

.headings-preview li {
  padding: 2px 0;
}

.headings-preview code {
  background: #e9ecef;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: 600;
}
