:root {
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --bg: #f5f6fb;
    --card: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --success: #059669;
    --danger: #dc2626;
    --radius: 12px;
}

* { box-sizing: border-box;
     /*outline: 1px solid red;*/
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    
}

.wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

.wrap.wide { max-width: 880px; }

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 20px;
    color: var(--primary);
    text-decoration: none;
}
.brand:hover { color: var(--primary-dark); }

.brand .dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--primary);
}

.brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
}

.site-intro {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.55;
    margin: 0 0 28px;
    max-width: 680px;
}

.brand-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.signed-in-as {
    font-size: 13px;
    color: var(--muted);
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    margin-bottom: 20px;
}

h1 { font-size: 24px; margin: 0 0 8px; }
h2 { font-size: 19px; margin: 0 0 8px; }
p.sub { color: var(--muted); margin-top: 0; }

label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin: 16px 0 6px;
}
label:first-child { margin-top: 0; }

input[type="text"],
input[type="email"],
input[type="datetime-local"],
textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    color: var(--text);
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}

textarea { resize: vertical; min-height: 90px; }

.otp-input {
    letter-spacing: 8px;
    font-size: 22px;
    text-align: center;
    font-weight: 700;
}

button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease;
}

button:hover, .btn:hover { background: var(--primary-dark); }
button:disabled { background: #a5a6f5; cursor: not-allowed; }

.btn-secondary {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: #f9fafb; }

.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }


.button-row {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.btn-block {
    flex: 1; /* takes up remaining space, instead of a fixed 100% width */
    margin-top: 18px;
}
.slot-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}
.slot-row input { flex: 1; }
.slot-remove {
    background: #fff;
    color: var(--danger);
    border: 1px solid var(--border);
    padding: 10px 13px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
}
.slot-remove:hover { background: #fef2f2; }

.slot-check {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
}
.slot-check:hover { background: #fafafa; }
.slot-check input { width: 18px; height: 18px; }
.slot-check .label { font-weight: 500; }
.slot-check .note { font-size: 12px; color: var(--muted); }

.msg {
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    display: none;
}
.msg.show { display: block; }
.msg.error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.msg.success { background: #ecfdf5; color: var(--success); border: 1px solid #a7f3d0; }
.msg.info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

.link-box {
    display: flex;
    gap: 8px;
    align-items: center;
    background: #f9fafb;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 5px 12px;
    font-family: monospace;
    font-size: 13px;
    word-break: break-all;
    flex-wrap: wrap; /* required for wrapping to happen at all */
}
.link-box code, .link-box a.link-text { flex: 1; }
.link-box a.link-text {
    color: var(--primary);
    text-decoration: none;
}
.link-box a.link-text:hover { text-decoration: underline; }
.copy-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}

.step { display: none; }
.step.active { display: block; }

.bar-row {
    margin-bottom: 14px;
}
.bar-row .top {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 6px;
}
.bar-row .top .dt { font-weight: 600; }
.bar-row .top .pct { color: var(--muted); }
.bar-track {
    background: #eef0f5;
    border-radius: 20px;
    height: 12px;
    overflow: hidden;
}
.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #818cf8);
    border-radius: 20px;
}
.best-badge {
    display: inline-block;
    background: #ecfdf5;
    color: var(--success);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table.participants {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
table.participants th, table.participants td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
}
table.participants th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }

.stat-row { display: flex; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.stat {
    flex: 1;
    min-width: 120px;
    background: #f9fafb;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
}
.stat .num { font-size: 24px; font-weight: 700; color: var(--primary); }
.stat .lbl { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }

.spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.resend-link {
    display: inline-block;
    margin-top: 12px;
    font-size: 13px;
    color: var(--primary);
    cursor: pointer;
    text-decoration: underline;
}
.resend-link.disabled { color: var(--muted); cursor: not-allowed; text-decoration: none; }

.footer-note {
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    margin-top: 24px;
}

.empty-state { text-align: center; color: var(--muted); padding: 30px 0; }

.event-card {
    background: #fbfbfd;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    margin-top: 16px;
}
.event-card-head { margin-bottom: 4px; }
.event-card-title {
    font-weight: 700;
    font-size: 17px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.event-card-meta { font-size: 13px; color: var(--muted); margin-top: 4px; }

.badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}
.badge-active { background: #ecfdf5; color: var(--success); }
.badge-pending { background: #fffbeb; color: #b45309; }
.badge-archived { background: #f3f4f6; color: var(--muted); }

.back-link {
    display: inline-block;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 16px;
}
.back-link:hover { text-decoration: underline; }
/* Following are custom by me */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  
}

.modal-box {
  background: white;
  padding: 24px;
  border-radius: 8px;
  max-width: 350px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  
}
.modal-box button {
  margin: 10px 6px 0;
  padding: 8px 16px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
}
.link-style {
  background: none;
  border: none;
  padding: 2px;
  color: #0066cc;        /* typical link blue, adjust to your site's link color */
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
  margin: 2px; /* matches surrounding text size/font instead of default button font */
}

.link-style:hover {
  color: #ffffff;        /* darker on hover, like a typical link */
   background: var(--primary-dark); 
}

.link-style:focus {
  outline: 2px solid #0066cc; /* keep visible focus state for accessibility */
  outline-offset: 2px;
}
.paid-status {
    display: inline-block;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.paid-status-paid {
    background-color: #e6f4ea;
    color: #1e7e34;
}

.paid-status-donation {
    background-color: #e8f0fe;
    color: #1a56db;
}

.paid-status-unknown {
    background-color: #f1f1f1;
    color: #666;
}

/* Upgrade status — draws attention since it needs action */
.paid-status-upgrade {
    background-color: #fff4e5;
    border: 1px solid #ffd28a;
    color: #8a5a00;
}

.upgrade-link {
    color: #cc5500;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.upgrade-link:hover {
    color: #a34400;
    text-decoration: none;
}

.upgrade-link:focus {
    outline: 2px solid #cc5500;
    outline-offset: 2px;
}
.events-table {
    width: 100%;
    /*min-width: 500px;*/ /* adjust based on your actual content — prevents columns from getting too cramped */
    border-collapse: collapse;
}

.events-table th,
.events-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.events-table th {
    font-weight: 600;
    color: #333;
    background-color: #f8f8f8;
}

.events-table tbody tr:hover {
    background-color: #fafafa;
}
.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* smooth momentum scrolling on iOS */
}
.slot-pill {
    display: inline-block;
    background-color: transparent;
    color: #3730a3;
    padding: 4px 12px;
    margin: 2px 4px 2px 0;
    border: 1px solid #3730a3;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
}
.force-new-line {
    flex-basis: 100%; /* takes up the full row, pushing next items down */
}
.link-label-row {
    flex-basis: 100%;
}
.bookmark-prompt {
    margin: 16px 0;
}

.bookmark-prompt p {
    margin-bottom: 8px;
    font-size: 14px;
    color: #555;
}
/* Mobile screens */
@media (max-width: 600px) {
    .wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 8px 15px 8px 15px;
    }

    .wrap.wide { max-width: 600px; }
    .card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    margin-bottom: 20px;
    }
    .event-card {
    background: #fbfbfd;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
    margin-bottom: 16px;
    }
    .btn-secondary {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 5px;
}
}
