:root {
    color-scheme: light;
    --bg-start: #f8efe2;
    --bg-end: #dceeff;
    --card: rgba(255, 255, 255, 0.9);
    --text: #1e2235;
    --muted: #667085;
    --accent: #0f766e;
    --accent-strong: #14532d;
    --error: #b42318;
    --success: #166534;
    --border: rgba(29, 36, 51, 0.12);
    --shadow: 0 24px 60px rgba(29, 36, 51, 0.14);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Space Grotesk", sans-serif;
    color: var(--text);
    background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(20, 83, 45, 0.14), transparent 24%),
        linear-gradient(135deg, var(--bg-start), var(--bg-end));
}

.shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.card {
    width: min(100%, 560px);
    padding: 36px 32px;
    border: 1px solid var(--border);
    border-radius: 30px;
    background: var(--card);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
}

.eyebrow {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.75rem;
    color: var(--accent-strong);
}

h1 {
    margin: 0;
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 0.95;
}

.intro {
    margin: 16px 0 18px;
    color: var(--muted);
    line-height: 1.6;
    font-size: 1.02rem;
}

.steps {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 26px;
}

.steps span {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.08);
    color: var(--accent-strong);
    font-size: 0.85rem;
    font-weight: 500;
}

.shortener-form {
    display: grid;
    gap: 14px;
}

.field-label,
.result-label {
    font-size: 0.95rem;
    font-weight: 500;
}

.field-help,
.result-subtitle,
.copy-status {
    margin: -6px 0 0;
    font-size: 0.88rem;
    color: var(--muted);
}

.field-help {
    margin-bottom: 4px;
}

input,
button {
    width: 100%;
    border-radius: 16px;
    font: inherit;
}

input {
    padding: 16px 18px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.95);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
    border-color: var(--accent);
}

button {
    border: 0;
    padding: 16px 18px;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

button:hover:not(:disabled),
button:focus-visible:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(14, 116, 144, 0.22);
}

button:disabled {
    cursor: wait;
    opacity: 0.75;
}

.message {
    min-height: 1.5rem;
    margin-top: 18px;
    font-size: 0.98rem;
    font-weight: 500;
}

.message.pending {
    color: var(--muted);
}

.message.success {
    color: var(--success);
}

.message.error {
    color: var(--error);
}

.result {
    margin-top: 18px;
    padding: 20px;
    min-height: 152px;
    border-radius: 22px;
    background: rgba(15, 118, 110, 0.08);
    border: 1px solid rgba(15, 118, 110, 0.14);
    transition: opacity 160ms ease, transform 160ms ease;
}

.result a {
    color: var(--accent-strong);
    font-weight: 700;
    word-break: break-all;
}

.result-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.result-label {
    margin: 0;
}

.result-subtitle {
    margin-top: 6px;
}

.result-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
}

.result-row a {
    min-width: 0;
    padding: 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(15, 118, 110, 0.12);
    text-decoration: none;
    font-size: 1rem;
}

.copy-button {
    width: auto;
    min-width: 120px;
    padding-inline: 22px;
    white-space: nowrap;
}

.copy-button:disabled {
    cursor: not-allowed;
}

.hidden {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
}

@media (max-width: 640px) {
    .card {
        padding: 24px;
        border-radius: 22px;
    }

    .result-header,
    .result-row {
        grid-template-columns: 1fr;
        display: grid;
    }

    .copy-button {
        width: 100%;
    }
}