/* Shared styles for landing, auth and settings pages */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body.app {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  min-height: 100vh;
  color: #1a1a2e;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  background: #fff;
  width: 100%;
  max-width: 440px;
  border-radius: 16px;
  padding: 36px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.card.wide {
  max-width: 640px;
}

h1 {
  font-size: 1.8em;
  margin-bottom: 8px;
}

.subtitle {
  color: #555;
  margin-bottom: 24px;
  line-height: 1.5;
}

label {
  display: block;
  font-weight: 600;
  margin: 16px 0 6px;
  font-size: 0.95em;
}

input[type='text'],
input[type='email'],
input[type='password'],
input[type='number'],
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cfd4e0;
  border-radius: 8px;
  font-size: 1em;
  background: #fff;
  color: #1a1a2e;
}

dialog {
  width: min(440px, calc(100% - 32px));
  margin: auto;
  padding: 28px;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

#device-code {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font: 700 1.4em monospace;
}

.dialog-actions {
  display: flex;
  gap: 10px;
}

.dialog-actions button {
  margin-top: 20px;
}

.device-title {
  margin-top: 40px;
}

.device-list {
  margin-top: 8px;
}

.device-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #e6e9f0;
}

.device-row div {
  min-width: 0;
}

.device-row .device-actions {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}

.device-row span {
  display: block;
  margin-top: 3px;
  color: #777;
  font-size: 0.78em;
}

.device-row button {
  width: auto;
  margin: 0;
  padding: 8px 12px;
  font-size: 0.85em;
}

button.danger {
  color: #b3261e;
}

input:focus,
select:focus {
  outline: none;
  border-color: #2a5298;
  box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.15);
}

.hint {
  font-size: 0.82em;
  color: #777;
  margin-top: 4px;
}

button {
  width: 100%;
  margin-top: 24px;
  padding: 13px;
  border: none;
  border-radius: 8px;
  background: #2a5298;
  color: #fff;
  font-size: 1.05em;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

button:hover {
  background: #1e3c72;
}

button.secondary {
  background: #eef1f7;
  color: #2a5298;
}

button.secondary:hover {
  background: #e0e5ef;
}

.links {
  margin-top: 20px;
  text-align: center;
  font-size: 0.95em;
}

a {
  color: #2a5298;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.message {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 0.95em;
  display: none;
}

.message.error {
  display: block;
  background: #fdecea;
  color: #b3261e;
}

.message.success {
  display: block;
  background: #e6f4ea;
  color: #1e7e34;
}

.url-box {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.url-box input {
  flex: 1;
  background: #f5f7fb;
}

.url-box button {
  width: auto;
  margin-top: 0;
  white-space: nowrap;
  padding: 12px 16px;
}

.row {
  display: flex;
  gap: 16px;
}

.row > div {
  flex: 1;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.topbar button {
  width: auto;
  margin-top: 0;
  padding: 8px 14px;
  font-size: 0.9em;
}

.hero-features {
  list-style: none;
  margin: 20px 0;
  line-height: 2;
  color: #444;
}

/* Settings: Google Calendar section */
.card hr {
  border: none;
  border-top: 1px solid #e6e9f0;
  margin: 26px 0 18px;
}

.section-title {
  font-size: 1.15em;
  margin: 0 0 10px;
  color: #1e3c72;
}

.google-block {
  margin-bottom: 8px;
}

.connected-line {
  margin: 0 0 12px;
  color: #333;
}

.button-link {
  display: inline-block;
  margin-top: 4px;
  padding: 11px 16px;
  border-radius: 8px;
  background: #2a5298;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.button-link:hover {
  background: #1e3c72;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-weight: 500;
}

.checkbox-row input {
  width: auto;
  margin: 0;
}

#reauth-notice .button-link {
  margin-left: 8px;
  padding: 6px 12px;
  font-size: 0.85em;
}

.calendar-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 6px 0 4px;
}

.calendar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  cursor: pointer;
}

.calendar-row input {
  width: auto;
  margin: 0;
}

.calendar-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: #ccc;
  flex: 0 0 auto;
}

/* Live theme preview (a compact mock of the public dashboard). Uses the same
   CSS variables as styles.css, scoped via data-theme on the wrapper. */
.theme-preview {
  margin-top: 8px;
  border: 1px solid #cfd4e0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
}

.tp-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--head-color));
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.tp-title {
  font-weight: 700;
  font-size: 1.05em;
}

.tp-time {
  font-size: 0.85em;
  opacity: 0.95;
}

.tp-panel {
  background: var(--panel-bg);
  color: var(--panel-text);
  padding: 8px;
}

.tp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.tp-head {
  font-size: 0.6em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--head-color);
}

.tp-cell {
  min-height: 38px;
  border: 1px solid var(--cell-border);
  border-radius: 4px;
  background: var(--cell-bg);
  padding: 2px 3px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.tp-cell.past {
  background: var(--cell-past-bg);
}

.tp-cell.today {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.tp-num {
  font-size: 0.58em;
  font-weight: 600;
  color: var(--day-num-color);
}

.tp-cell.today .tp-num {
  color: var(--accent);
}

.tp-chip {
  font-size: 0.55em;
  line-height: 1.3;
  background: var(--chip-bg);
  color: var(--chip-text);
  border: 1px solid var(--chip-border);
  border-left: 2px solid var(--accent);
  border-radius: 2px;
  padding: 0 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tp-chip.all-day {
  background: var(--all-day-bg);
  border-left-color: var(--all-day-border);
}
