/**
 * One popup design for every attendance message.
 * Compact centred card on desktop, bottom sheet on phones.
 */
.att-notice-layer {
  --an-ink: #0f172a;
  --an-ink-2: #475569;
  --an-ink-3: #64748b;
  --an-bg: #ffffff;
  --an-line: #e2e8f0;
  --an-soft: #f8fafc;
  --an-accent: #1d4ed8;
  --an-accent-ink: #ffffff;
  --an-tone: #b45309;
  --an-tone-soft: #fef3c7;
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: rgba(15, 23, 42, 0);
  -webkit-backdrop-filter: blur(0);
  backdrop-filter: blur(0);
  transition: background .18s ease, backdrop-filter .18s ease;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Bengali", sans-serif;
}
.att-notice-layer[hidden] { display: none; }
.att-notice-layer.is-in {
  background: rgba(15, 23, 42, .45);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
html.att-notice-open { overflow: hidden; }

.att-notice {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  max-width: 400px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 26px 24px 20px;
  border-radius: 20px;
  background: var(--an-bg);
  color: var(--an-ink);
  box-shadow: 0 24px 60px -12px rgba(15, 23, 42, .35), 0 0 0 1px rgba(15, 23, 42, .04);
  text-align: center;
  transform: translateY(8px) scale(.98);
  opacity: 0;
  transition: transform .2s cubic-bezier(.2, .8, .2, 1), opacity .2s ease;
}
.att-notice-layer.is-in .att-notice { transform: none; opacity: 1; }

.att-notice--error { --an-tone: #b91c1c; --an-tone-soft: #fee2e2; }
.att-notice--warning { --an-tone: #b45309; --an-tone-soft: #fef3c7; }
.att-notice--info { --an-tone: #1d4ed8; --an-tone-soft: #dbeafe; }
.att-notice--success { --an-tone: #047857; --an-tone-soft: #d1fae5; }
.att-notice--progress { --an-tone: #1d4ed8; --an-tone-soft: #dbeafe; }

.att-notice__x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--an-ink-3);
  font-size: 22px;
  line-height: 32px;
  cursor: pointer;
}
.att-notice__x:hover, .att-notice__x:focus-visible { background: var(--an-soft); color: var(--an-ink); outline: none; }

.att-notice__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 18px;
  background: var(--an-tone-soft);
  color: var(--an-tone);
}
.att-notice__icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.att-notice__spinner {
  width: 26px;
  height: 26px;
  border: 3px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: att-notice-spin .8s linear infinite;
}
@keyframes att-notice-spin { to { transform: rotate(360deg); } }

.att-notice__title {
  margin: 0 0 6px;
  color: var(--an-ink);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.01em;
}
.att-notice__message {
  margin: 0 auto;
  max-width: 34ch;
  color: var(--an-ink-2);
  font-size: 14.5px;
  line-height: 1.5;
}

.att-notice__facts {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 16px 0 0;
}
.att-notice__fact {
  flex: 1 1 0;
  min-width: 0;
  max-width: 140px;
  padding: 8px 6px;
  border: 1px solid var(--an-line);
  border-radius: 12px;
  background: var(--an-soft);
}
.att-notice__fact dt { margin: 0; color: var(--an-ink-3); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.att-notice__fact dt, .att-notice__fact dd { overflow-wrap: anywhere; }
.att-notice__fact dd { margin: 2px 0 0; color: var(--an-ink); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }

.att-notice__tip {
  display: grid;
  gap: 2px;
  margin: 16px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--an-tone);
  border-radius: 10px;
  background: var(--an-soft);
  text-align: left;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--an-ink-2);
}
.att-notice__tip strong { color: var(--an-ink); font-size: 12px; letter-spacing: .03em; text-transform: uppercase; }

.att-notice__reason {
  margin: 12px 0 0;
  color: var(--an-ink-3);
  font-size: 12px;
  line-height: 1.4;
}

.att-notice__actions {
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  margin-top: 20px;
}
@media (min-width: 420px) {
  .att-notice__actions { flex-direction: row; justify-content: center; }
  .att-notice__actions .att-notice__btn { flex: 1 1 0; }
}
.att-notice__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--an-line);
  border-radius: 12px;
  background: var(--an-bg);
  color: var(--an-ink);
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.att-notice__btn:hover { background: var(--an-soft); text-decoration: none; }
.att-notice__btn--primary { border-color: var(--an-accent); background: var(--an-accent); color: var(--an-accent-ink); }
.att-notice__btn--primary:hover { background: #1e40af; color: var(--an-accent-ink); }
.att-notice__btn:focus-visible, .att-notice__x:focus-visible { outline: 3px solid rgba(29, 78, 216, .35); outline-offset: 2px; }

/* Phones: bottom sheet. */
@media (max-width: 560px) {
  .att-notice-layer { align-items: flex-end; padding: 0; }
  .att-notice {
    max-width: none;
    max-height: 88vh;
    padding: 22px 20px calc(18px + env(safe-area-inset-bottom, 0px));
    border-radius: 22px 22px 0 0;
    transform: translateY(24px);
  }
  .att-notice::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    margin: -10px auto 14px;
    border-radius: 2px;
    background: var(--an-line);
  }
}

@media (prefers-color-scheme: dark) {
  .att-notice-layer {
    --an-ink: #f1f5f9;
    --an-ink-2: #cbd5e1;
    --an-ink-3: #94a3b8;
    --an-bg: #111827;
    --an-line: #1f2937;
    --an-soft: #0b1220;
    --an-accent: #3b82f6;
  }
  .att-notice--error { --an-tone: #fca5a5; --an-tone-soft: rgba(239, 68, 68, .16); }
  .att-notice--warning { --an-tone: #fcd34d; --an-tone-soft: rgba(245, 158, 11, .16); }
  .att-notice--info, .att-notice--progress { --an-tone: #93c5fd; --an-tone-soft: rgba(59, 130, 246, .16); }
  .att-notice--success { --an-tone: #6ee7b7; --an-tone-soft: rgba(16, 185, 129, .16); }
}

@media (prefers-reduced-motion: reduce) {
  .att-notice, .att-notice-layer { transition: none; }
  .att-notice__spinner { animation-duration: 2s; }
}
