:root {
    --bg: #eaf4fd;
    --bg-2: #f7fbff;
    --card: rgba(255, 255, 255, 0.9);
    --text: #0f172a;
    --muted: #475569;
    --border: #cbd5e1;
    --focus: #006dc5;
    --button: #006dc5;
    --button-hover: #00539a;
    --error: #b91c1c;
    --ok: #166534;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    padding: 24px 14px;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 20% 10%, #b8defa 0%, transparent 38%),
        radial-gradient(circle at 90% 85%, #d7ebfb 0%, transparent 34%),
        linear-gradient(180deg, var(--bg-2), var(--bg));
}

.wrapper {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
}

.logo {
    display: flex;
    justify-content: center;
}

.logo img {
    width: 100%;
    max-width: 100px;
    height: auto;
}

.card {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    padding: clamp(18px, 3.2vw, 28px);
    backdrop-filter: blur(8px);
    box-shadow:
        0 8px 25px rgba(0, 109, 197, 0.16),
        0 2px 8px rgba(15, 23, 42, 0.08);
}

.title {
    margin: 0 0 8px;
    font-size: clamp(1.35rem, 2.4vw, 1.75rem);
    line-height: 1.2;
}

.subtitle {
    margin: 0 0 22px;
    color: var(--muted);
    font-size: 0.95rem;
}

form {
    display: grid;
    gap: 14px;
}

.row {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
}

@media (min-width: 680px) {
    .row.two {
        grid-template-columns: 1fr 1fr;
    }
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

label {
    font-size: 0.92rem;
    font-weight: 650;
}

input:not([type="checkbox"]) {
    width: 100%;
    height: 46px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0 13px;
    font-size: 1rem;
    line-height: 1.2;
    background: #fff;
    color: var(--text);
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input[type="date"] {
    height: 46px;
    padding-right: 40px;
    overflow: hidden;
    -webkit-appearance: none;
    appearance: none;
}

input[type="date"]::-webkit-date-and-time-value {
    text-align: left;
    padding: 0;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    margin: 0;
    padding: 0;
}

input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

input[type="file"]::file-selector-button {
    display: none;
}

.file-input-wrapper {
    position: relative;
    height: 46px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.file-input-wrapper:focus-within {
    border-color: var(--focus);
    box-shadow: 0 0 0 4px rgba(0, 109, 197, 0.2);
}

.file-input-text {
    display: grid;
    place-items: center;
    height: 100%;
    padding: 0 13px;
    color: #94a3b8;
    font-size: 1rem;
    line-height: 1;
    pointer-events: none;
}

.file-input-text.file-selected {
    color: var(--text);
}

input::placeholder {
    color: #94a3b8;
}

input:not([type="checkbox"]):focus {
    border-color: var(--focus);
    box-shadow: 0 0 0 4px rgba(0, 109, 197, 0.2);
}

input:not([type="checkbox"]):disabled {
    background: #f1f5f9;
    color: #64748b;
    border-color: #cbd5e1;
    cursor: not-allowed;
    opacity: 1;
}

input:not([type="checkbox"]):disabled:focus {
    box-shadow: none;
}

.event-info {
    margin: 0 0 18px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}

.event-info p {
    margin: 0;
    font-size: 0.94rem;
    color: var(--muted);
}

.event-info p+p {
    margin-top: 6px;
}

.event-info a {
    color: var(--focus);
    text-decoration: underline;
}

.checkbox-label a {
    color: var(--focus);
    text-decoration: underline;
}

.checkbox-label a:visited {
    color: var(--focus);
}

.field-checkbox {
    gap: 0;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: var(--muted);
    line-height: 1.35;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 0;
    width: 18px;
    height: 18px;
    accent-color: var(--focus);
    flex-shrink: 0;
}

button {
    margin-top: 8px;
    border: 0;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #1a85d7, var(--button));
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.2s ease;
}

button:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    cursor: wait;
    filter: none;
    opacity: 0.9;
    transform: none;
}

button.is-loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

button.is-loading::before {
    content: "";
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #ffffff;
    animation: spin 0.75s linear infinite;
}

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

.status {
    font-size: 0.92rem;
}

.status:empty {
    display: none;
}

.status:not(:empty) {
    margin-top: 14px;
}

.status.error {
    color: var(--error);
}

.status.ok {
    color: var(--ok);
}

.sponsors {
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.sponsors-title {
    margin: 0 0 10px;
    font-size: 0.98rem;
}

.sponsors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

.sponsor-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}

.add-sponsor-btn {
    width: 100%;
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    background: rgba(203, 213, 225, 0.1);
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: default;
}

.reading-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1000;
}

.reading-modal.is-open {
    display: flex;
}

.reading-modal-content {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    font-weight: 600;
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.2);
}

.reading-modal-content p {
    margin: 0;
}

.reading-spinner {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(0, 109, 197, 0.22);
    border-top-color: var(--focus);
    animation: spin 0.75s linear infinite;
}