/* Account, sharing and preview date panels. Colors and sizes come from the
   Figma panels: light blue card, cream paper inputs with a blue line, 22px
   titles, 44px inputs and wide buttons. */
:root {
  --panel-blue: #daf3ff;
  --panel-paper: #fffaf0;
  --panel-cream: #fef3e3;
  --panel-ink: #302920;
  --panel-muted: #594c43;
  --panel-line: #83bdda;
  --panel-focus: #3aade7;
  --panel-focus-ring: #bfe9fe;
  --panel-danger: #ca3c2d;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Panel */
.account-panel {
  color-scheme: light;
  width: min(406px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: var(--panel-blue);
  color: var(--panel-ink);
  font-family: Roboto, sans-serif;
  overflow: auto;
  overscroll-behavior: contain;
  box-shadow: 0 20px 60px #1d2a3140;
}
.account-panel::backdrop {
  background: #1d2a3166;
}
.account-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 24px 24px;
}
.account-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
}
.account-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: 700 12px/1.4 Roboto, sans-serif;
  cursor: pointer;
}
.account-panel h2 {
  margin: 0;
  font: 500 22px/1.45 Roboto, sans-serif;
  outline: none;
}
.account-text,
.account-small {
  margin: 0;
  font: 400 14px/1.45 Roboto, sans-serif;
}
.account-small {
  font-size: 13px;
}
.account-hint {
  margin: 0;
  color: var(--panel-muted);
  font: 400 12px/1.4 Roboto, sans-serif;
}
.account-eyebrow {
  margin: 0;
  color: var(--panel-muted);
  font: 500 12px/1.4 Roboto, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.account-error {
  margin: 0;
  color: var(--panel-danger);
  font: 400 13px/1.4 Roboto, sans-serif;
}
.account-error:empty {
  display: none;
}
.account-divider {
  width: 100%;
  margin: 0;
  border: 0;
  border-top: 1px solid #83bdda99;
}

/* Fields */
.account-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.account-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.account-field label {
  font: 500 12px/1.4 Roboto, sans-serif;
}
.account-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--panel-line);
  border-radius: 12px;
  background: var(--panel-paper);
  color: var(--panel-ink);
  font: 400 16px/1.4 Roboto, sans-serif;
}
.account-input::placeholder {
  color: #594c43b3;
}
.account-input:focus-visible {
  border-color: var(--panel-focus);
  outline: none;
  box-shadow: 0 0 0 3px var(--panel-focus-ring);
}
.account-input[aria-invalid="true"] {
  border-color: var(--panel-danger);
}
.account-link-field {
  font-size: 14px;
  text-overflow: ellipsis;
}
.account-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 400 12px/1.4 Roboto, sans-serif;
  cursor: pointer;
}
.account-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--panel-focus);
}

/* Buttons inside panels use the Figma panel size. */
.account-panel .account-wide {
  width: 100%;
  --button-height: 44px;
  --button-text-size: 14px;
  --button-text-line: 20px;
}
.account-panel .ui-button--secondary {
  box-shadow: inset 0 0 0 1px var(--panel-line);
}
@media (hover: hover) and (pointer: fine) {
  .account-panel .ui-button--secondary:not(:disabled):hover {
    box-shadow: inset 0 0 0 1px var(--panel-line), var(--button-shadow-hover);
  }
}
.account-link {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.account-small .account-link {
  font-weight: 500;
}
.account-link--danger {
  color: var(--panel-danger);
}
.account-link:focus-visible,
.account-back:focus-visible,
.calendar-open:focus-visible {
  outline: 2px solid var(--panel-ink);
  outline-offset: 3px;
  border-radius: 4px;
}

/* My calendars */
.calendar-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.calendar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 10px 12px;
  border-radius: 16px;
  background: var(--panel-paper);
}
.calendar-open {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.calendar-name {
  max-width: 100%;
  overflow: hidden;
  font: 500 14px/1.4 Roboto, sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-meta {
  color: var(--panel-muted);
  font: 400 12px/1.4 Roboto, sans-serif;
}
@media (hover: hover) and (pointer: fine) {
  .calendar-open:hover .calendar-name {
    text-decoration: underline;
    text-underline-offset: 2px;
  }
}

/* Not ready to share */
.empty-days {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -6px 0 0;
  padding: 0;
  list-style: none;
}
.empty-day {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--panel-line);
  border-radius: 50%;
  background: var(--panel-paper);
  font: 500 13px/1 Roboto, sans-serif;
}

/* My calendars button, top left while a calendar is open */
.account-action {
  position: absolute;
  left: 5%;
  top: calc(var(--house-width) * 130 / 1122);
  z-index: 7;
}
@media (max-width: 620px) {
  .account-action {
    left: 12px;
    top: 12px;
  }
}

/* Preview date picker */
#date-control.preview-day {
  position: relative;
  display: block;
}
.preview-day-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--panel-line);
  border-radius: 999px;
  background: var(--panel-cream);
  color: var(--panel-ink);
  font: 700 13px/1 Roboto, sans-serif;
  box-shadow: 0 2px 8px #2a2a2a14;
  cursor: pointer;
}
.preview-day-button[aria-expanded="true"] {
  border-color: var(--panel-focus);
  box-shadow: 0 0 0 1px var(--panel-focus);
}
.preview-day-button[aria-expanded="true"] .preview-day-chevron {
  rotate: 180deg;
}
.preview-day-button:focus-visible {
  outline: 2px solid var(--panel-ink);
  outline-offset: 3px;
}
.preview-day-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  width: 272px;
  padding: 16px;
  border: 1px solid var(--panel-line);
  border-radius: 12px;
  background: var(--panel-paper);
  color: var(--panel-ink);
  box-shadow: 0 12px 32px #2a2a2a26;
}
.preview-day-title {
  margin: 0;
  font: 500 14px/1.4 Roboto, sans-serif;
}
.preview-day-hint {
  margin: 2px 0 10px;
  color: var(--panel-muted);
  font: 400 12px/1.4 Roboto, sans-serif;
}
.preview-day-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}
.preview-day-weekday {
  padding: 4px 0;
  color: var(--panel-muted);
  font: 500 11px/1.4 Roboto, sans-serif;
}
.preview-day-grid button {
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: inherit;
  font: 400 14px/1 Roboto, sans-serif;
  cursor: pointer;
}
.preview-day-grid button[aria-pressed="true"] {
  background: var(--panel-focus-ring);
  font-weight: 700;
}
.preview-day-grid button:focus-visible {
  outline: 2px solid var(--panel-focus);
  outline-offset: -2px;
}
@media (hover: hover) and (pointer: fine) {
  .preview-day-grid button:not([aria-pressed="true"]):hover {
    background: var(--panel-blue);
  }
}
