:root {
    --bg: #f8f4ed;
    --card: #fffdfa;
    --ink: #1c1a18;
    --accent: #0f766e;
    --accent-strong: #115e59;
    --danger: #b42318;
    --danger-bg: #fef3f2;
    --success: #065f46;
    --success-bg: #ecfdf3;
    --line: #d7cec2;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Assistant', sans-serif;
    color: var(--ink);
    background: url('/assets/media/back.avif') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    line-height: 1.5;
    padding-bottom: 128px;
}

.page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.card {
    width: min(920px, 100%);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 1.5rem;
    box-shadow: 0 14px 30px rgba(17, 24, 39, 0.08);
}

.page-header {
    display: flex;
    justify-content: center;
    margin-bottom: 0.65rem;
}

.logo-link {
    display: inline-block;
    border-radius: 12px;
}

.logo-link:focus-visible {
    outline: 3px solid #2f855a;
    outline-offset: 4px;
}

.logo-link:hover .site-logo {
    filter: drop-shadow(0 8px 14px rgba(15, 118, 110, 0.22));
    transform: translateY(-1px);
}

.site-logo {
    width: min(260px, 70vw);
    height: auto;
    transition: transform 140ms ease, filter 140ms ease;
}

h1 {
    margin-top: 0;
    margin-bottom: 0.4rem;
    font-size: clamp(1.35rem, 2.2vw, 2rem);
}

.subtitle {
    margin-top: 0;
    margin-bottom: 1.2rem;
    color: #5a544e;
}

.success-screen {
    border: 1px solid #b7e4c7;
    background: linear-gradient(180deg, #f3fff7 0%, #eafff2 100%);
    border-radius: 14px;
    padding: 1.25rem;
    text-align: center;
    gap: 2px;
}

.success-link {
    display: inline-block;
    margin-top: 0.5rem;
    text-decoration: none;
    background: var(--accent);
    color: #fff;
    border-radius: 999px;
    padding: 0.5rem 1rem;
    font-weight: 700;
}

.success-link:hover {
    background: var(--accent-strong);
}

.secondary-link {
    display: inline-block;
    margin-top: 0.6rem;
    text-decoration: none;
    color: #2f4f67;
    font-weight: 700;
}

.secondary-link:hover {
    text-decoration: underline;
}

.source-link {
    display: inline-block;
    text-decoration: none;
    color: #fff;
    background: #3b4d62;
    border-radius: 999px;
    padding: 0.4rem 0.85rem;
    font-weight: 700;
    transition: all 200ms ease;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
}

.source-link:hover:not(:disabled) {
    background: #2d3a4a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.source-link:active:not(:disabled) {
    transform: translateY(0);
}

.source-link:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.source-link.is-loading {
    position: relative;
}

label {
    display: grid;
    gap: 0.35rem;
    font-weight: 600;
}

input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    min-height: 42px;
    padding: 0.55rem 0.7rem;
    font: inherit;
    background: #fff;
}

input:focus {
    outline: 2px solid #14b8a6;
    outline-offset: 1px;
}

.actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
}

button {
    border: 0;
    border-radius: 10px;
    min-height: 42px;
    padding: 0.55rem 1rem;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.remove-btn {
    background: #ece7dd;
    color: #2d2926;
}

.submit-btn {
    background: var(--accent);
    color: #fff;
}

.submit-btn:hover {
    background: var(--accent-strong);
}

.submit-btn:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

.submit-btn.is-loading {
    position: relative;
    padding-inline-start: 2.3rem;
}

.submit-btn.is-loading::before {
    content: '';
    position: absolute;
    inset-inline-start: 0.85rem;
    top: 50%;
    width: 14px;
    height: 14px;
    margin-top: -7px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: submit-spin 0.7s linear infinite;
}

@keyframes submit-spin {
    to {
        transform: rotate(360deg);
    }
}

.remove-btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.alert {
    border-radius: 10px;
    padding: 0.7rem 0.9rem;
    margin-bottom: 1rem;
    border: 1px solid;
}

.alert p {
    margin: 0;
}

.alert-error {
    border-color: #fecdca;
    color: var(--danger);
    background: var(--danger-bg);
}

.alert-success {
    border-color: #abefc6;
    color: var(--success);
    background: var(--success-bg);
}

.page-footer {
    position: fixed;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    width: min(920px, calc(100% - 1.2rem));
    z-index: 30;
    text-align: center;
    padding: 0;
}

.donation-callout {
    border: 1px solid rgba(212, 184, 130, 0.65);
    border-radius: 16px;
    background:
        radial-gradient(circle at top left, rgba(255, 246, 221, 0.82), transparent 50%),
        linear-gradient(135deg, rgba(255, 251, 243, 0.92) 0%, rgba(248, 238, 222, 0.94) 100%);
    backdrop-filter: blur(4px);
    padding: 0.72rem 1rem;
    box-shadow: 0 12px 26px rgba(70, 50, 18, 0.2);
}

.donation-title {
    margin: 0;
    font-weight: 700;
    color: #4e3c24;
}

.donation-subtitle {
    margin: 0.2rem 0 0.65rem;
    color: #6b5a42;
}

.donation-button {
    display: inline-block;
    text-decoration: none;
    background: linear-gradient(180deg, #b88a2e 0%, #8d6418 100%);
    color: #fff;
    border-radius: 999px;
    padding: 0.48rem 1rem;
    font-weight: 700;
    box-shadow: 0 6px 12px rgba(112, 78, 17, 0.2);
}

.donation-button:hover {
    filter: brightness(1.04);
}

@media (max-width: 768px) {
    body {
        background-attachment: scroll;
        padding-bottom: 150px;
    }

    .page {
        padding: 0.75rem;
        place-items: start center;
    }

    .card {
        padding: 0.9rem;
        border-radius: 14px;
    }

    .actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .actions button,
    .remove-btn,
    .source-link {
        width: 100%;
    }

    .page-footer {
        width: calc(100% - 0.8rem);
        bottom: 8px;
    }

    .donation-button {
        width: 100%;
        text-align: center;
    }

    .success-screen {
        padding: 1rem;
    }
}
