/* ════════════════════════════════════════════════════════════
   COUNTDOWN CLOCK · Tool 006 · countdown.css
   All .cd- prefixed. Inherits CSS vars from header.php
═══════════════════════════════════════════════════════════ */

/* ── HERO ── */
.cd-hero {
    max-width: 960px;
    margin: 0 auto;
    padding: 7.5rem 3rem 3rem;
}
.cd-eyebrow {
    font-family: 'DM Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--red);
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 1.1rem;
    animation: cd-up 0.5s ease both;
}
.cd-eyebrow::before {
    content: '';
    width: 18px;
    height: 1px;
    background: currentColor;
    opacity: 0.7;
}
.cd-h1 {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: -0.03em;
    color: var(--ink);
    margin-bottom: 1rem;
    animation: cd-up 0.5s 0.08s ease both;
}
.cd-h1 em { color: var(--red); font-style: normal; }
.cd-subtitle {
    font-size: 0.95rem;
    font-weight: 300;
    color: var(--muted);
    line-height: 1.75;
    max-width: 540px;
    animation: cd-up 0.5s 0.16s ease both;
}

/* ── CREATE LAYOUT ── */
.cd-create-wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 2.5rem 3rem 6rem;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2.5rem;
    align-items: start;
}

/* ── SHARED CARD ── */
.cd-card {
    background: var(--bg2);
    border: 1.5px solid var(--border);
    border-radius: 22px;
    padding: 2.2rem;
    box-shadow: 0 2px 14px rgba(0,0,0,0.04);
}
.cd-card-header { margin-bottom: 1.6rem; }
.cd-mono-label {
    font-family: 'DM Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    display: block;
    margin-bottom: 0.4rem;
}
.cd-card-title {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--ink);
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin: 0;
}

/* ── FORM FIELDS ── */
.cd-field { margin-bottom: 1.3rem; }
.cd-field label {
    display: block;
    font-family: 'DM Mono', monospace;
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.45rem;
}
.cd-required { color: var(--red); margin-left: 2px; }
.cd-optional { text-transform: none; letter-spacing: 0; font-size: 0.65rem; color: var(--border2); }

.cd-field input[type="text"],
.cd-field input[type="email"],
.cd-field input[type="date"],
.cd-field input[type="time"],
.cd-field select,
.cd-field textarea {
    width: 100%;
    font-family: 'Sora', sans-serif;
    font-size: 0.92rem;
    font-weight: 300;
    color: var(--ink);
    background: var(--bg3);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    appearance: none;
    -webkit-appearance: none;
}
.cd-field input:focus,
.cd-field select:focus,
.cd-field textarea:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(232,64,42,.1);
    background: #fff;
}
.cd-field textarea {
    resize: vertical;
    min-height: 85px;
    line-height: 1.6;
}
.cd-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238c8680' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}
.cd-help {
    font-size: 0.74rem;
    color: var(--muted);
    margin-top: 0.4rem;
    line-height: 1.5;
}
.cd-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.cd-field-row .cd-field { margin-bottom: 0; }

/* ── REMINDER CHECKBOXES ── */
.cd-reminder-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.cd-reminder-chip {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    background: var(--bg3);
    border: 1.5px solid var(--border);
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.15s;
}
.cd-reminder-chip:has(input:checked) {
    background: #fff4f3;
    border-color: rgba(232,64,42,.35);
}
.cd-reminder-chip input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--red);
    cursor: pointer;
    flex-shrink: 0;
}
.cd-reminder-chip label {
    font-size: 0.82rem;
    color: var(--text);
    cursor: pointer;
    margin: 0;
    letter-spacing: 0;
    text-transform: none;
    font-family: 'Sora', sans-serif;
    font-weight: 300;
}

/* ── BUTTONS ── */
.cd-btn-submit {
    width: 100%;
    padding: 0.95rem 1.5rem;
    font-family: 'DM Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #fff;
    background: var(--red);
    border: none;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(232,64,42,.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    margin-top: 0.5rem;
}
.cd-btn-submit:hover {
    background: var(--red2);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(232,64,42,.32);
}
.cd-btn-submit:active { transform: scale(0.98); }

.cd-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: 'DM Mono', monospace;
    font-size: 0.64rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--bg3);
    border: 1.5px solid var(--border);
    border-radius: 100px;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}
.cd-btn-secondary:hover { border-color: var(--border2); color: var(--ink); }

.cd-btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: 'DM Mono', monospace;
    font-size: 0.64rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #c0392b;
    background: #fff4f3;
    border: 1.5px solid rgba(232,64,42,.28);
    border-radius: 100px;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    transition: all 0.15s;
}
.cd-btn-danger:hover { background: var(--red); border-color: var(--red); color: #fff; }

/* ── ALERTS ── */
.cd-error, .cd-success, .cd-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.85rem 1.1rem;
    border-radius: 12px;
    border: 1.5px solid;
    font-family: 'DM Mono', monospace;
    font-size: 0.72rem;
    margin-bottom: 1.2rem;
    line-height: 1.5;
}
.cd-error   { background:#fff4f3; border-color:rgba(232,64,42,.28); color:#c0392b; }
.cd-success { background:#f0fdf4; border-color:rgba(42,110,64,.28);  color:#2a6e40; }
.cd-notice  { background:#fffbeb; border-color:rgba(245,158,11,.28); color:#92400e; }

/* ── SIDE CARDS ── */
.cd-side-card {
    background: var(--bg2);
    border: 1.5px solid var(--border);
    border-radius: 20px;
    padding: 1.6rem;
    margin-bottom: 1rem;
}
.cd-side-card:last-child { margin-bottom: 0; }

.cd-steps {
    list-style: none;
    counter-reset: cd-step;
    padding: 0;
    margin: 0.7rem 0 0;
}
.cd-steps li {
    counter-increment: cd-step;
    position: relative;
    padding-left: 2rem;
    font-size: 0.84rem;
    font-weight: 300;
    color: var(--muted);
    line-height: 1.65;
    margin-bottom: 0.55rem;
}
.cd-steps li:last-child { margin-bottom: 0; }
.cd-steps li::before {
    content: counter(cd-step);
    position: absolute;
    left: 0;
    top: 1px;
    width: 20px;
    height: 20px;
    background: var(--red);
    color: #fff;
    font-family: 'DM Mono', monospace;
    font-size: 0.58rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cd-steps li strong { color: var(--ink); font-weight: 600; }

.cd-feat-list {
    list-style: none;
    padding: 0;
    margin: 0.7rem 0 0;
}
.cd-feat-list li {
    font-size: 0.84rem;
    font-weight: 300;
    color: var(--muted);
    line-height: 1.65;
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.cd-feat-list li:last-child { border-bottom: none; }
.cd-feat-list li::before {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--red);
    flex-shrink: 0;
}

/* ── HONEYPOT ── */
.cd-hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

/* ── DISCLAIMER ── */
.cd-disclaimer {
    font-size: 0.72rem;
    color: var(--muted);
    line-height: 1.6;
    margin-top: 1rem;
    text-align: center;
}

/* ════════════════════════════════════════════
   VIEW PAGE
════════════════════════════════════════════ */
.cd-view-wrap {
    max-width: 680px;
    margin: 0 auto;
    padding: 7.5rem 3rem 6rem;
}

/* ── New countdown banner ── */
.cd-new-banner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    background: #f0fdf4;
    border: 1.5px solid rgba(42,110,64,.25);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    margin-bottom: 2rem;
    font-size: 0.84rem;
    color: #2a6e40;
    line-height: 1.55;
}
.cd-new-banner strong { font-weight: 600; }
.cd-new-banner-close {
    background: none;
    border: none;
    color: #2a6e40;
    cursor: pointer;
    opacity: 0.5;
    flex-shrink: 0;
    padding: 2px;
    margin-top: 2px;
    transition: opacity 0.15s;
}
.cd-new-banner-close:hover { opacity: 1; }

/* ── View header block ── */
.cd-view-header {
    padding-bottom: 2rem;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--border);
}

.cd-view-eyebrow {
    font-family: 'DM Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.cd-view-eyebrow::before {
    content: '';
    width: 14px;
    height: 1px;
    background: var(--border2);
}
.cd-view-title {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    color: var(--ink);
    line-height: 1.1;
    margin-bottom: 1rem;
    word-break: break-word;
}
.cd-view-desc {
    font-size: 0.93rem;
    font-weight: 400;
    color: var(--ink);
    opacity: 0.7;
    line-height: 1.75;
    margin-bottom: 1.2rem;
}
/* Date as a pill chip */
.cd-view-date {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'DM Mono', monospace;
    font-size: 0.63rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink);
    background: var(--bg2);
    border: 1.5px solid var(--border);
    border-radius: 100px;
    padding: 0.45rem 0.95rem 0.45rem 0.75rem;
}

/* ── Countdown timer ── */
.cd-timer-section { margin-bottom: 2rem; }
.cd-timer {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.cd-timer-unit {
    background: var(--bg2);
    border: 1.5px solid var(--border);
    border-radius: 18px;
    padding: 1.6rem 0.75rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.cd-timer-unit::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: var(--red);
    transform: scaleX(0);
    transform-origin: left;
    border-radius: 1px;
}
.cd-timer-unit.cd-tick::after {
    animation: cd-tick-line 0.5s ease forwards;
}
@keyframes cd-tick-line {
    0%   { transform: scaleX(0); opacity: 1; }
    50%  { transform: scaleX(1); opacity: 1; }
    100% { transform: scaleX(1); opacity: 0; }
}
.cd-timer-value {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 900;
    color: var(--ink);
    line-height: 1;
    letter-spacing: -0.03em;
    display: block;
}
.cd-timer-value.cd-flip {
    animation: cd-flip 0.25s ease;
}
@keyframes cd-flip {
    0%   { opacity: 0.4; transform: translateY(-5px); }
    100% { opacity: 1;   transform: translateY(0); }
}
.cd-timer-label {
    font-family: 'DM Mono', monospace;
    font-size: 0.55rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    margin-top: 0.5rem;
    display: block;
}

/* ── Progress bar ── */
.cd-progress-wrap { margin-bottom: 2rem; }
.cd-progress-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.cd-progress-label {
    font-family: 'DM Mono', monospace;
    font-size: 0.57rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}
.cd-progress-pct {
    font-family: 'DM Mono', monospace;
    font-size: 0.6rem;
    color: var(--red);
    font-weight: 500;
}
.cd-progress-track {
    height: 5px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 100px;
    overflow: hidden;
}
.cd-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--red) 0%, var(--red2) 100%);
    border-radius: 100px;
    transition: width 1s linear;
    min-width: 2px;
}

/* ── Actions ── */
.cd-view-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}
.cd-btn-copy {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: 'DM Mono', monospace;
    font-size: 0.64rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #fff;
    background: var(--red);
    border: none;
    border-radius: 100px;
    padding: 0.65rem 1.3rem;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 4px 14px rgba(232,64,42,.25);
}
.cd-btn-copy:hover { background: var(--red2); transform: translateY(-1px); }
.cd-btn-copy.copied {
    background: #2a6e40;
    box-shadow: 0 4px 14px rgba(42,110,64,.2);
}

/* ── Embed panel ── */
.cd-embed-panel {
    background: var(--bg3);
    border: 1.5px solid var(--border);
    border-radius: 16px;
    padding: 1.3rem 1.5rem;
    margin-bottom: 1.5rem;
    animation: cd-up 0.2s ease;
}
.cd-embed-panel[hidden] { display: none; }
.cd-embed-title {
    font-family: 'DM Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.8rem;
}
.cd-embed-code {
    font-family: 'DM Mono', monospace;
    font-size: 0.7rem;
    background: var(--mono-bg);
    color: var(--mono-text);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    word-break: break-all;
    line-height: 1.6;
    margin-bottom: 0.75rem;
    user-select: all;
}

/* ── Past state ── */
.cd-past-section {
    text-align: center;
    padding: 2.5rem 2rem 2rem;
    background: var(--bg3);
    border: 1.5px solid var(--border);
    border-radius: 20px;
    margin-bottom: 2rem;
}
.cd-past-icon { margin-bottom: 1rem; line-height: 1; }
.cd-past-title {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--ink);
    margin-bottom: 0.5rem;
}
.cd-past-sub { font-size: 0.88rem; color: var(--muted); line-height: 1.6; }

.cd-not-found-icon { margin-bottom: .5rem; }

/* ── CTA ── */
.cd-cta {
    background: var(--bg3);
    border: 1.5px solid var(--border);
    border-radius: 20px;
    padding: 1.6rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: 2rem;
}
.cd-cta-text {
    font-size: 0.88rem;
    font-weight: 300;
    color: var(--muted);
    line-height: 1.65;
}
.cd-cta-text strong { color: var(--ink); font-weight: 700; }
.cd-cta-btn {
    flex-shrink: 0;
    font-family: 'DM Mono', monospace;
    font-size: 0.64rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--red);
    background: none;
    border: 1.5px solid var(--red);
    border-radius: 100px;
    padding: 0.6rem 1.2rem;
    text-decoration: none;
    transition: all 0.15s;
    display: inline-block;
}
.cd-cta-btn:hover { background: var(--red); color: #fff; }

/* ════════════════════════════════════════════
   EDIT PAGE
════════════════════════════════════════════ */
.cd-edit-wrap {
    max-width: 600px;
    margin: 0 auto;
    padding: 7.5rem 3rem 6rem;
}
.cd-edit-back {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: 'DM Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    margin-bottom: 1.8rem;
    transition: color 0.15s;
}
.cd-edit-back:hover { color: var(--ink); }

.cd-share-box {
    background: var(--bg3);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.cd-share-box-url {
    font-family: 'DM Mono', monospace;
    font-size: 0.7rem;
    color: var(--muted);
    word-break: break-all;
    line-height: 1.4;
}

.cd-delete-zone {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}
.cd-delete-zone-label {
    font-family: 'DM Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.6rem;
}
.cd-delete-zone-desc {
    font-size: 0.84rem;
    font-weight: 300;
    color: var(--muted);
    margin-bottom: 1rem;
    line-height: 1.6;
}

/* ════════════════════════════════════════════
   ANIMATIONS
════════════════════════════════════════════ */
@keyframes cd-up {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════ */
@media (max-width: 760px) {
    .cd-create-wrap     { grid-template-columns: 1fr; padding: 2rem 1.5rem 4rem; }
    .cd-hero            { padding: 7rem 1.5rem 2.5rem; }
    .cd-view-wrap       { padding: 7rem 1.5rem 4rem; }
    .cd-edit-wrap       { padding: 7rem 1.5rem 4rem; }
    .cd-timer           { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
    .cd-field-row       { grid-template-columns: 1fr; }
    .cd-field-row .cd-field { margin-bottom: 1.3rem; }
    .cd-cta             { flex-direction: column; text-align: center; }
    .cd-view-actions    { flex-direction: column; align-items: stretch; }
    .cd-btn-copy,
    .cd-btn-secondary   { justify-content: center; }
}
