/* ================= RESET ================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ================= ROOT ================= */
:root {
    --primary: #6366f1;
    --secondary: #ec4899;
    --success: #22c55e;
    --error: #ef4444;

    --bg1: #eef2ff;
    --bg2: #fdf2f8;

    --card: #ffffff;
    --soft: #f9fafb;
    --border: #e5e7eb;
    --gray: #6b7280;

    --radius: 18px;
    --shadow: 0 14px 32px rgba(0,0,0,0.08);
}

/* ================= BASE ================= */
html {
    scroll-behavior: smooth;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: linear-gradient(180deg, var(--bg1), var(--bg2));
    color: #111827;
    line-height: 1.6;
    font-size: 16px;

    /* 🔑 FULL CENTER FIX */
    display: flex;
    justify-content: center;
}

/* ================= LINKS ================= */
a {
    text-decoration: none;
    color: inherit;
}

/* ================= CONTAINER ================= */
.container {
    width: 100%;
    max-width: 860px;
    padding: 24px 14px 48px;
}

/* ================= HERO ================= */
.hero-section {
    text-align: center;
    margin-bottom: 22px;
}

.main-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--gray);
    max-width: 560px;
    margin: 0 auto;
}

/* ================= CARD ================= */
.card,
.messages-container {
    background: var(--card);
    border-radius: var(--radius);
    padding: 22px;
    margin: 18px auto;
    box-shadow: var(--shadow);
    text-align: center;
}

.card h2 {
    color: var(--primary);
    margin-bottom: 10px;
}

.card h3 {
    margin-bottom: 8px;
}

.description {
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 14px;
}

/* ================= FORM ================= */
.form-group {
    margin-bottom: 16px;
    text-align: left;
}

label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 6px;
}

input,
textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1.5px solid var(--border);
    font-size: 0.95rem;
    background: #fafafa;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: #ffffff;
}

textarea {
    resize: vertical;
    min-height: 110px;
}

small {
    font-size: 0.75rem;
    color: var(--gray);
}

/* ================= BUTTONS ================= */
.btn {
    width: 100%;
    padding: 12px;
    border-radius: 16px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: 0.25s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
}

.btn-primary:hover {
    transform: scale(1.03);
}

.btn-secondary {
    background: #f3f4f6;
    color: var(--primary);
    border: 1px solid var(--border);
}

.btn-copy {
    background: var(--primary);
    color: #fff;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.8rem;
}

/* ================= LINK BOX ================= */
.link-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.link-box input {
    text-align: center;
    font-family: monospace;
    font-size: 0.8rem;
}

/* ================= ALERTS ================= */
.message {
    margin-top: 14px;
    padding: 12px;
    border-radius: 14px;
    font-size: 0.85rem;
}

.message.success {
    background: #dcfce7;
    color: #166534;
}

.message.error {
    background: #fee2e2;
    color: #7f1d1d;
}

.warning {
    background: #fff7ed;
    padding: 12px;
    border-radius: 14px;
    font-size: 0.85rem;
}

/* ================= MESSAGE LIST ================= */
.message-card {
    background: var(--soft);
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 12px;
    text-align: left;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sender-name {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.85rem;
}

.message-time {
    font-size: 0.7rem;
    color: var(--gray);
}

.delete-btn {
    margin-left: 6px;
    cursor: pointer;
    opacity: 0.6;
}

.delete-btn:hover {
    opacity: 1;
    color: var(--error);
}

/* ================= FOOTER ================= */
.footer {
    margin-top: 32px;
    font-size: 0.8rem;
    color: var(--gray);
    text-align: center;
}

/* ================= DESKTOP ================= */
@media (min-width: 768px) {
    .container {
        padding: 40px 20px 64px;
    }

    .link-box {
        flex-direction: row;
    }

    .link-box input {
        text-align: left;
    }
}
