* {
    box-sizing: border-box;
}

:root {
    --bg-1: #edf2ff;
    --bg-2: #f8fbff;
    --bg-3: #ffffff;
    --primary: #ed312f;
    --primary-dark: #c72321;
    --primary-light: #f04a47;
    --primary-soft: rgba(237, 49, 47, 0.10);
    --primary-softer: rgba(237, 49, 47, 0.05);
    --text: #18203b;
    --text-soft: #697391;
    --text-faint: #8f98b3;
    --border: #f3d6d5;
    --border-strong: #efb6b4;
    --danger: #d7263d;
    --success: #17825e;
    --shadow-xl: 0 36px 100px rgba(237, 49, 47, 0.14);
    --shadow-lg: 0 22px 60px rgba(237, 49, 47, 0.12);
    --shadow-md: 0 14px 32px rgba(237, 49, 47, 0.10);
    --shadow-sm: 0 8px 18px rgba(237, 49, 47, 0.07);
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 14px;
    --container-width: 980px;
    --transition: 0.24s ease;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: 'Assistant', sans-serif;
    color: var(--text);
background:
    radial-gradient(circle at 85% 10%, rgba(240, 74, 71, 0.18), transparent 0 22%),
    radial-gradient(circle at 10% 90%, rgba(237, 49, 47, 0.12), transparent 0 24%),
    linear-gradient(180deg, #fff2f2 0%, #fff8f8 55%, #ffffff 100%);
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(255,255,255,0.18), rgba(255,255,255,0.18)),
        repeating-linear-gradient(
            90deg,
            transparent 0,
            transparent 86px,
            rgba(51, 67, 179, 0.022) 87px,
            transparent 88px
        );
    opacity: 0.7;
}

body::after {
    content: "";
    position: fixed;
    width: 420px;
    height: 420px;
    left: -160px;
    bottom: -180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(51, 67, 179, 0.09), transparent 68%);
    pointer-events: none;
}

.page-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 34px 16px 18px;
    position: relative;
    z-index: 1;
}

.container,
.payment-card {
    width: 100%;
    max-width: var(--container-width);
    position: relative;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255,255,255,0.65);
    border-radius: var(--radius-xl);
    padding: 34px;
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(14px);
    overflow: hidden;
}

.container::before,
.payment-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 7px;
    background: linear-gradient(90deg, #f04a47 0%, #ed312f 52%, #c72321 100%);
}

.container::after,
.payment-card::after {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    left: -90px;
    top: -70px;
    background: radial-gradient(circle, rgba(77, 99, 230, 0.10), transparent 70%);
    pointer-events: none;
}

.hero {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 22px;
    align-items: center;
    margin-bottom: 22px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(51, 67, 179, 0.08);
}

.hero-text {
    min-width: 0;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 9px 14px;
    border-radius: 999px;
    background: var(--primary-soft);
    border: 1px solid rgba(51, 67, 179, 0.12);
    color: var(--primary);
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.42);
}

.hero-kicker i {
    font-size: 13px;
}

.hero-text h1,
h1 {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: clamp(2rem, 4vw, 2.7rem);
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
}

.hero-subtitle {
    margin: 10px 0 0;
    font-size: 1rem;
    line-height: 1.7;
    font-weight: 700;
    color: var(--text-soft);
}

.hero-description {
    margin: 12px 0 0;
    max-width: 640px;
    font-size: 1.02rem;
    line-height: 1.8;
    color: var(--text-soft);
}

.hero-logo {
    position: relative;
    flex: 0 0 auto;
}

.hero-logo::before {
    content: "";
    position: absolute;
    inset: 14% -8% -14% -8%;
    border-radius: 24px;
    background: radial-gradient(circle, rgba(51, 67, 179, 0.10), transparent 72%);
    filter: blur(10px);
    pointer-events: none;
}

.hero-logo img,
h1 img {
    position: relative;
    z-index: 1;
    display: block;
    height: 82px;
    width: auto;
    max-width: 240px;
    object-fit: contain;
    filter: drop-shadow(0 12px 24px rgba(51, 67, 179, 0.12));
}

.helper-row {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 18px;
}

.helper-link a,
.title a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-weight: 800;
    font-size: 0.98rem;
    text-decoration: none;
    padding: 11px 16px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(244,247,255,0.92));
    border: 1px solid rgba(51, 67, 179, 0.12);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
}

.helper-link a::before,
.title a::before {
    content: "ⓘ";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 14px;
    line-height: 1;
}

.helper-link a:hover,
.title a:hover {
    transform: translateY(-2px);
    color: var(--primary-dark);
    box-shadow: var(--shadow-md);
    background: linear-gradient(180deg, rgba(255,255,255,1), rgba(240,244,255,1));
}

.payment-form,
form.ajax {
    position: relative;
    z-index: 1;
    margin-top: 0;
    padding: 28px;
    background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(247,249,255,0.98) 100%);
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.payment-form::before,
form.ajax::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(51, 67, 179, 0.12), transparent);
}

.input-field {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 13px 0;
    font-size: 18px;
    flex-wrap: wrap;
}

.input-field + .input-field {
    border-top: 1px solid rgba(51, 67, 179, 0.06);
}

.input-field label {
    flex: 0 0 138px;
    font-weight: 800;
    color: var(--text);
    font-size: 1rem;
    line-height: 1.3;
}

.input-field input {
    flex: 1;
    width: 100%;
    min-width: 0;
    height: 58px;
    padding: 0 18px;
    border: 1px solid var(--border-strong);
    border-radius: 18px;
    background: #ffffff;
    box-shadow:
        inset 0 1px 2px rgba(0,0,0,0.03),
        0 10px 24px rgba(51, 67, 179, 0.04);
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--text);
    text-align: right;
    direction: ltr;
    letter-spacing: 1px;
    transition:
        border-color var(--transition),
        box-shadow var(--transition),
        transform var(--transition),
        background var(--transition);
}

.input-field input::placeholder {
    color: #a3acc7;
    font-weight: 500;
    letter-spacing: 0;
    font-style: normal;
}

.input-field input:hover {
    border-color: #b5c1f2;
    box-shadow:
        inset 0 1px 2px rgba(0,0,0,0.03),
        0 12px 28px rgba(51, 67, 179, 0.06);
}

.input-field input:focus {
    outline: none;
    border-color: rgba(51, 67, 179, 0.55);
    background: #fff;
    box-shadow:
        0 0 0 5px rgba(51, 67, 179, 0.12),
        0 14px 32px rgba(51, 67, 179, 0.10);
    transform: translateY(-1px);
}

.input-error {
    flex: 0 0 100%;
    margin-top: 6px;
    padding: 12px 14px;
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg, #ea4258, #c91f35);
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 800;
    box-shadow: 0 10px 20px rgba(201, 31, 53, 0.18);
}

.buttons {
    margin: 28px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

button {
    font-family: 'Assistant', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

button.reset {
    min-width: 110px;
    height: 50px;
    padding: 0 18px;
    background: transparent;
    color: var(--danger);
    border: 0;
    outline: none;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
    border-radius: 12px;
    transition: background var(--transition), color var(--transition), transform var(--transition);
}

button.reset:hover {
    background: rgba(215, 38, 61, 0.06);
    text-decoration: none;
    transform: translateY(-1px);
}

button.submit,
.status-button--primary,
.select-file-btn {
    min-width: 182px;
    height: 56px;
    padding: 0 24px;
    background: linear-gradient(135deg, #f04a47 0%, #ed312f 56%, #c72321 100%);
    color: #fff;
    font-size: 1.14rem;
    font-weight: 800;
    border: 0;
    outline: none;
    cursor: pointer;
    border-radius: 18px;
    margin-right: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow:
        0 18px 34px rgba(237, 49, 47, 0.28),
        inset 0 1px 0 rgba(255,255,255,0.20);
    transition:
        transform var(--transition),
        box-shadow var(--transition),
        filter var(--transition);
    text-decoration: none;
}

button.submit:hover,
.status-button--primary:hover,
.select-file-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 22px 38px rgba(237, 49, 47, 0.32),
        inset 0 1px 0 rgba(255,255,255,0.20);
    filter: saturate(1.05);
}

button.submit:active,
.status-button--primary:active,
.select-file-btn:active {
    transform: translateY(0);
}

button.submit i {
    font-size: 1rem;
}

.bottom,
.contact-box {
    position: relative;
    z-index: 1;
    margin-top: 24px;
    padding: 18px 18px 14px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(51, 67, 179, 0.04), rgba(51, 67, 179, 0.02));
    border: 1px solid rgba(51, 67, 179, 0.08);
    text-align: center;
    font-size: 0.98rem;
    line-height: 1.9;
    color: var(--text-soft);
    box-shadow: var(--shadow-sm);
}

.bottom a,
.contact-box a {
    color: var(--text);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.bottom a:hover,
.contact-box a:hover {
    color: var(--primary);
}

.declaration {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-faint);
}

.legal-link {
    text-align: center;
    margin-top: 12px;
    position: relative;
    z-index: 1;
}

.legal-link a {
    color: #6d7592;
    font-size: 13px;
    text-decoration: none;
    border-bottom: 1px solid rgba(109, 117, 146, 0.35);
    transition: color var(--transition), border-color var(--transition);
}

.legal-link a:hover {
    color: var(--primary);
    border-bottom-color: rgba(51, 67, 179, 0.5);
}

hr {
    border: 0;
    height: 1px;
    margin: 30px 0;
    background: linear-gradient(90deg, transparent, rgba(51, 67, 179, 0.14), transparent);
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(21, 28, 61, 0.52);
    backdrop-filter: blur(10px);
    padding: 24px;
    overflow-y: auto;
}

.modal-content {
    position: relative;
    max-width: 920px;
    width: 100%;
    margin: 40px auto;
    padding: 32px;
    background: rgba(255,255,255,0.97);
    border-radius: 30px;
    box-shadow: 0 30px 90px rgba(0,0,0,0.18);
    border: 1px solid rgba(255,255,255,0.7);
    max-height: unset;
}

.close {
    position: absolute;
    top: 18px;
    left: 18px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(51, 67, 179, 0.08);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
    float: none;
}

.close:hover {
    background: rgba(51, 67, 179, 0.14);
    transform: rotate(90deg);
}

.lity-active,
.lity-active body,
body.modal-open {
    overflow: hidden;
}

.lity-active,
.lity-backdrop {
    z-index: 999999;
}

.lity-container {
    max-width: 980px;
}

.lity-content {
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.22);
}

.multiple-files-modal h3 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--text);
    font-size: 1.15rem;
    font-weight: 800;
}

.files-list {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    gap: 10px 20px;
    flex-wrap: wrap;
    align-items: start;
    justify-content: start;
}

.file-option {
    border: 1px solid rgba(51, 67, 179, 0.10);
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(247,249,255,0.96));
    flex: 0 0 260px;
    box-shadow: var(--shadow-sm);
}

.file-details {
    margin-bottom: 10px;
    line-height: 1.6;
    color: var(--text-soft);
}

.form-section {
    margin-bottom: 18px;
    padding: 22px 20px;
    background: rgba(255,255,255,0.72);
    border-radius: 22px;
    border: 1px solid rgba(51, 67, 179, 0.08);
    box-shadow: var(--shadow-sm);
}

.form-section h3 {
    margin: 0 0 10px 0;
    color: var(--text);
    font-size: 1.15rem;
    font-weight: 800;
}

.form-guide {
    margin: 0 0 20px 0;
    color: var(--text-soft);
    font-size: 14px;
    line-height: 1.7;
}

.input-field input.valid {
    border-color: #28a745;
    background-color: #f8fff9;
}

.input-field input.invalid {
    border-color: #dc3545;
    background-color: #fff8f8;
}

button.submit.disabled {
    background: linear-gradient(135deg, #aeb7da 0%, #95a0cb 100%);
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

button.submit.disabled:hover {
    background: linear-gradient(135deg, #aeb7da 0%, #95a0cb 100%);
    transform: none;
    box-shadow: none;
    filter: none;
}

.notification {
    position: fixed;
    bottom: 20px;
    margin: auto;
    right: 20px;
    left: 20px;
    z-index: 10000;
    max-width: 400px;
    min-width: 300px;
    display: none;
    box-shadow: var(--shadow-md);
    border-radius: 16px;
    font-family: Assistant, sans-serif;
    overflow: hidden;
}

.notification-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-radius: 16px;
}

.notification-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 700;
}

.notification-close {
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    margin-right: 10px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.notification-close:hover {
    opacity: 1;
}

.notification-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.notification-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.notification-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.notification-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.disabled-field {
    background-color: #f5f5f5 !important;
    color: #999 !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

.disabled-field:focus {
    outline: none !important;
    box-shadow: none !important;
}

.input-field input:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

button.button.green.small {
    color: green;
}

table#af_posts_table button.button.small + button,
table#af_posts_table button.button.small {
    display: inline-block;
}

tr.post-tr[data-status="1"] td {
    color: green;
}

tr.post-tr[data-status="1"] td button.green {
    display: none !important;
}

@media (max-width: 860px) {
    .container,
    .payment-card {
        padding: 24px 18px;
    }

    .hero {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .hero-logo {
        order: -1;
    }

    .hero-logo img,
    h1 img {
        height: 64px;
        max-width: 190px;
    }

    .hero-subtitle,
    .hero-description {
        max-width: none;
    }

    .payment-form,
    form.ajax {
        padding: 22px 16px;
    }

    .input-field label {
        flex: 0 0 120px;
    }
}

@media (max-width: 720px) {
    .page-shell {
        padding: 16px 10px 12px;
    }

    .container,
    .payment-card {
        padding: 18px 14px;
        border-radius: 22px;
    }

    .hero {
        gap: 14px;
        margin-bottom: 16px;
        padding-bottom: 18px;
    }

    .hero-kicker {
        font-size: 13px;
        padding: 8px 12px;
    }

    .hero-text h1,
    h1 {
        font-size: 1.7rem;
        line-height: 1.08;
    }

    .hero-subtitle {
        font-size: 0.94rem;
    }

    .hero-description {
        font-size: 0.95rem;
        line-height: 1.75;
    }

    .hero-logo img,
    h1 img {
        height: 56px;
        max-width: 160px;
    }

    .helper-link a,
    .title a {
        width: 100%;
        justify-content: center;
        text-align: center;
        border-radius: 16px;
        font-size: 0.95rem;
    }

    .payment-form,
    form.ajax {
        padding: 18px 14px;
        border-radius: 18px;
    }

    .input-field {
        gap: 8px;
        padding: 10px 0;
    }

    .input-field label {
        flex: 0 0 100%;
        font-size: 0.94rem;
    }

    .input-field input {
        height: 52px;
        font-size: 1.03rem;
        border-radius: 14px;
        padding: 0 15px;
    }

    .buttons {
        margin-top: 18px;
        flex-direction: column-reverse;
        align-items: stretch;
    }

    button.submit,
    button.reset {
        width: 100%;
        margin-right: 0;
    }

    button.submit {
        min-width: 0;
        height: 54px;
    }

    .bottom,
    .contact-box {
        font-size: 0.91rem;
        padding: 15px 12px 12px;
        border-radius: 18px;
    }

    .declaration {
        font-size: 12.5px;
    }

    .legal-link {
        margin-top: 10px;
    }

    .modal {
        padding: 12px;
    }

    .modal-content {
        margin: 18px auto;
        padding: 22px 16px;
        border-radius: 20px;
    }

    .close {
        top: 12px;
        left: 12px;
        width: 38px;
        height: 38px;
        font-size: 24px;
    }

    .form-section {
        padding: 18px 14px;
        border-radius: 18px;
    }

    .files-list {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .file-option {
        flex: 1 1 auto;
        border-radius: 16px;
    }

    .notification {
        min-width: 0;
        width: calc(100% - 20px);
        left: 10px;
        right: 10px;
        bottom: 12px;
    }

    .notification-content {
        padding: 13px 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}