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

#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f6f9;
}

#login-box {
  background: white;
  border-radius: 8px;
  padding: 2.5rem 3rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  text-align: center;
  max-width: 380px;
  width: 100%;
}

#login-box h1 { font-size: 1.4rem; color: #0078d4; margin-bottom: 0.75rem; }
#login-box p  { font-size: 0.9rem; color: #555; margin-bottom: 1.75rem; line-height: 1.5; }

#btn-login {
  background: #0078d4;
  color: white;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 4px;
  font-size: 0.95rem;
  cursor: pointer;
  font-weight: 500;
  width: 100%;
  transition: background 0.15s;
}
#btn-login:hover { background: #106ebe; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f6f9;
  color: #1a1a1a;
  min-height: 100vh;
}

header {
  background: #0078d4;
  color: white;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header h1 { font-size: 1.25rem; font-weight: 600; }
#user-name { font-size: 0.875rem; opacity: 0.85; }

#btn-logout {
  background: transparent;
  color: white;
  border: 1px solid rgba(255,255,255,0.5);
  padding: 0.35rem 0.85rem;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s;
}
#btn-logout:hover { background: rgba(255,255,255,0.15); }

main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

section {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

h2 { font-size: 1rem; font-weight: 600; margin-bottom: 1.25rem; color: #333; }

.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 0.8rem; font-weight: 500; color: #555; margin-bottom: 0.3rem; }

.field-row { display: flex; align-items: center; gap: 0.4rem; }
.field-row input { flex: 1; }

.field input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
}
.field input:focus { border-color: #0078d4; }

.btn-reset {
  background: none;
  border: none;
  color: #bbb;
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  transition: color 0.15s;
  flex-shrink: 0;
}
.btn-reset:hover { color: #0078d4; }

.hint { font-size: 0.78rem; color: #888; margin-top: 0.75rem; }

.loading-msg { font-size: 0.85rem; color: #888; margin-bottom: 1rem; display: none; }
#editor.loading .loading-msg { display: block; }
#editor.loading .field { opacity: 0.35; pointer-events: none; }
#editor.loading .hint { visibility: hidden; }

#preview-frame {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 1.25rem;
  background: #fafafa;
  min-height: 120px;
}

#actions {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

button.primary {
  background: #0078d4;
  color: white;
  border: none;
  padding: 0.6rem 1.25rem;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s;
}
button.primary:hover { background: #106ebe; }
button.primary:disabled { background: #aaa; cursor: default; }

#status { font-size: 0.85rem; color: #555; }
#status.success { color: #107c10; }
#status.error { color: #d13438; }
