/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Arimo', system-ui, -apple-system, sans-serif;
    background: url("img/bg_purple.jpg") repeat-x top center;
    background-color: #f0f2f8;
    min-height: 100vh;
    color: #2d2d3a;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ===== LAYOUT ===== */
.pay-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 24px 16px 40px;
}

/* ===== TOP BAR ===== */
.pay-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 700px;
    margin-bottom: 24px;
}

.pay-topbar__logo img {
    height: 30px;
    width: auto;
    display: block;
}

.pay-topbar__lang select {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 8px;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    padding: 6px 32px 6px 12px;
    cursor: pointer;
    outline: none;
    transition: background .2s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M1.646 4.646a.5.5 0 01.708 0L8 10.293l5.646-5.647a.5.5 0 01.708.708l-6 6a.5.5 0 01-.708 0l-6-6a.5.5 0 010-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.pay-topbar__lang select:hover,
.pay-topbar__lang select:focus {
    background-color: rgba(255,255,255,.32);
}

.pay-topbar__lang select option {
    color: #2d2d3a;
    background: #fff;
}

/* ===== CARD ===== */
.pay-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,.04), 0 12px 40px rgba(80,60,120,.10);
    width: 100%;
    max-width: 700px;
    overflow: hidden;
}

.pay-card__body {
    padding: 40px 32px 0;
}

/* ===== SELLER HEADER ===== */
.seller-header {
    text-align: center;
    padding-bottom: 8px;
}

.seller-header__logo {
    margin-bottom: 16px;
}

.seller-header__logo img {
    width: 160px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(80,60,120,.08);
}

.seller-header__badge {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #9b8ec2;
    margin-bottom: 6px;
}

.seller-header__name {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 4px;
    letter-spacing: -.01em;
    line-height: 1.3;
}

.seller-header__vat {
    font-size: 13px;
    color: #a0a0b0;
    font-weight: 400;
    letter-spacing: .01em;
}

/* ===== FORM SECTIONS ===== */
.pay-section {
    padding: 24px 32px;
}

.pay-form-area {
    padding: 24px 32px 0;
    border-top: 1px solid #eeeaf3;
}

.pay-form-area__row {
    margin-bottom: 18px;
    text-align: center;
}

.pay-form-area__label {
    font-size: 12px;
    font-weight: 600;
    color: #8a8a9e;
    margin-bottom: 8px;
    letter-spacing: .03em;
    text-transform: uppercase;
    text-align: center;
}

/* Amount input */
.amount-input-wrap {
    position: relative;
    max-width: 200px;
    margin: 0 auto;
}

.amount-input-wrap::before {
    content: "\20AC";
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    font-weight: 700;
    color: #b8b0cc;
    pointer-events: none;
}

input.pay-amount {
    width: 100%;
    padding: 14px 16px 14px 42px;
    font-size: 28px;
    font-weight: 700;
    font-family: inherit;
    color: #1a1a2e;
    text-align: center;
    border: 2px solid #ddd8e8;
    border-radius: 12px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    background: #fff;
}

input.pay-amount:focus {
    border-color: #7c6bc4;
    box-shadow: 0 0 0 3px rgba(124,107,196,.12);
    background: #fff;
}

input.pay-amount:disabled {
    background: #f4f3f7;
    color: #6e6e80;
    cursor: not-allowed;
    border-color: #e4e0ec;
}

/* Comments textarea */
textarea.pay-comments {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    font-family: inherit;
    color: #1a1a2e;
    border: 1.5px solid #ddd8e4;
    border-radius: 10px;
    outline: none;
    resize: vertical;
    min-height: 80px;
    transition: border-color .2s, box-shadow .2s;
    background: #f8f7fa;
    line-height: 1.6;
    text-align: left;
}

textarea.pay-comments:focus {
    border-color: #7c6bc4;
    box-shadow: 0 0 0 3px rgba(124,107,196,.10);
    background: #fff;
}

/* ===== RECEIPT TOGGLE ===== */
.receipt-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #f8f7fa;
    border-radius: 10px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: background .15s;
}

.receipt-toggle:hover {
    background: #f0eef5;
}

.receipt-toggle__check {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: 2px solid #ccc7d6;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    background: #fff;
}

.receipt-toggle__check.is-checked {
    background: #7c6bc4;
    border-color: #7c6bc4;
}

.receipt-toggle__check.is-checked i {
    color: #fff;
    font-size: 11px;
}

.receipt-toggle__text {
    font-size: 13px;
    font-weight: 500;
    color: #4a4a5e;
}

/* ===== DETAILS PANEL ===== */
.details-panel {
    margin-top: 14px;
}

/* Form fields */
input.pay-field {
    width: 100%;
    padding: 11px 14px;
    font-size: 16px;
    font-family: inherit;
    color: #1a1a2e;
    border: 1.5px solid #ddd8e4;
    border-radius: 10px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    background: #f8f7fa;
    margin-bottom: 8px;
}

input.pay-field:focus {
    border-color: #7c6bc4;
    box-shadow: 0 0 0 3px rgba(124,107,196,.10);
    background: #fff;
}

input.pay-field::placeholder {
    color: #a8a8b8;
    font-weight: 400;
}

input.pay-field.input-error {
    border-color: #e8b4b4;
    background: #fdf0ef;
}

input.pay-field.input-error:focus {
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192,57,43,.08);
}

.pay-typed-field {
    margin: 4px 0 12px;
}

.pay-typed-field__label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 6px;
    line-height: 1.4;
}

.pay-typed-field__required {
    color: #c0392b;
}

.pay-typed-field__hint {
    font-weight: 400;
    color: #6b7280;
}

.pay-typed-field input.pay-field {
    margin-bottom: 0;
}

.pay-typed-field input.pay-field[type="date"] {
    display: block;
    min-height: 44px;
    -webkit-appearance: none;
    appearance: none;
}

.pay-typed-field input.pay-field[type="date"]::-webkit-date-and-time-value {
    text-align: left;
}

.pay-select {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 11px 38px 11px 14px;
    font-size: 16px;
    font-family: inherit;
    color: #1a1a2e;
    border: 1.5px solid #ddd8e4;
    border-radius: 10px;
    outline: none;
    background: #f8f7fa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
}

.pay-select:focus {
    border-color: #7c6bc4;
    box-shadow: 0 0 0 3px rgba(124,107,196,.10);
    outline: none;
}

.pay-typed-field.has-error input.pay-field,
.pay-typed-field.has-error .pay-select {
    border-color: #e8b4b4;
    background-color: #fdf0ef;
}

.pay-typed-field.has-error input.pay-field:focus,
.pay-typed-field.has-error .pay-select:focus {
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192,57,43,.08);
}

.pay-field-error {
    font-size: 12px;
    color: #c0392b;
    margin: 4px 0 0;
    line-height: 1.4;
}

input.pay-field + .pay-field-error {
    margin: -4px 0 10px;
}

.pay-field-error[hidden] {
    display: none;
}

/* ===== PAY BUTTON ===== */
.pay-actions {
    padding: 24px 32px 32px;
    text-align: center;
}

a.pay-btn,
a.pay-btn:link,
a.pay-btn:visited,
a.pay-btn:active {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 48px;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    color: #fff;
    background-color: #6c5bb3;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .2s;
    letter-spacing: .01em;
}

a.pay-btn:hover {
    background-color: #5a4a9e;
    color: #fff;
    text-decoration: none;
}

/* ===== PAYMENT LINK (default.php) ===== */
.pay-link-amount {
    font-size: 40px;
    font-weight: 800;
    color: #1a1a2e;
    letter-spacing: -.02em;
    line-height: 1;
    padding: 8px 0 4px;
}

.pay-link-expire {
    font-size: 13px;
    font-weight: 500;
    color: #8a8a9e;
}

.pay-link-details {
    padding: 20px 32px 8px;
    border-top: 1px solid #eeeaf3;
}

.pay-link-details__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 8px 0;
}

.pay-link-details__row + .pay-link-details__row {
    border-top: 1px solid #f5f3f9;
}

.pay-link-details__label {
    font-size: 12px;
    font-weight: 600;
    color: #8a8a9e;
    text-transform: uppercase;
    letter-spacing: .04em;
    flex-shrink: 0;
    margin-right: 16px;
}

.pay-link-details__value {
    font-size: 14px;
    font-weight: 600;
    color: #2d2d3a;
    text-align: right;
    word-break: break-word;
}

/* Paid / success state */
.pay-success {
    text-align: center;
    padding: 40px 32px;
}

.pay-success__icon {
    color: #22c55e;
    margin-bottom: 16px;
    line-height: 1;
}

.pay-success__title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
}

/* Centering container for EverPay form */
.div-center {
    max-width: 500px;
    margin: 0 auto;
}

/* ===== LOADING ===== */
.pay-loading {
    text-align: center;
    padding: 40px 20px;
}

.pay-loading img {
    width: 48px;
    height: 48px;
}

/* ===== FOOTER ===== */
.pay-footer {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    padding: 8px 0;
}

a.pay-footer__link,
a.pay-footer__link:link,
a.pay-footer__link:visited,
a.pay-footer__link:active {
    font-size: 12px;
    color: #8a8a9e;
    text-decoration: none;
    transition: color .2s;
}

a.pay-footer__link:hover {
    color: #5a4a9e;
}

/* ===== RESPONSIVE ===== */

/* Tablet / small laptop */
@media (max-width: 768px) {
    .pay-wrapper {
        padding: 20px 14px 36px;
    }

    .pay-topbar__logo img {
        height: 26px;
    }

    .seller-header__logo img {
        width: 140px;
    }
}

/* Large phones */
@media (max-width: 640px) {
    .pay-wrapper {
        padding: 14px 10px 32px;
    }

    .pay-topbar {
        margin-bottom: 14px;
    }

    .pay-topbar__logo img {
        height: 22px;
    }

    .pay-card {
        border-radius: 12px;
    }

    .pay-card__body {
        padding: 28px 22px 0;
    }

    .pay-form-area {
        padding: 20px 22px 0;
    }

    .pay-section {
        padding: 20px 22px;
    }

    .pay-actions {
        padding: 20px 22px 26px;
    }

    .seller-header__logo img {
        width: 120px;
    }

    .seller-header__name {
        font-size: 21px;
    }

    .seller-header__badge {
        font-size: 10px;
    }

    .pay-link-amount {
        font-size: 34px;
    }

    .pay-link-details {
        padding: 18px 22px 6px;
    }

    .pay-success {
        padding: 32px 22px;
    }

    input.pay-amount {
        font-size: 24px;
        padding: 12px 14px 12px 38px;
    }

    .amount-input-wrap::before {
        font-size: 20px;
    }

    a.pay-btn,
    a.pay-btn:link,
    a.pay-btn:visited {
        padding: 14px 32px;
        width: 100%;
    }
}

/* Small phones */
@media (max-width: 420px) {
    .pay-wrapper {
        padding: 10px 8px 28px;
    }

    .pay-card {
        border-radius: 10px;
    }

    .pay-card__body {
        padding: 24px 16px 0;
    }

    .pay-form-area {
        padding: 18px 16px 0;
    }

    .pay-section {
        padding: 18px 16px;
    }

    .pay-actions {
        padding: 18px 16px 22px;
    }

    .seller-header {
        padding-bottom: 6px;
    }

    .seller-header__badge {
        font-size: 10px;
        margin-bottom: 5px;
    }

    .seller-header__logo {
        margin-bottom: 12px;
    }

    .seller-header__logo img {
        width: 100px;
    }

    .seller-header__name {
        font-size: 19px;
    }

    .seller-header__vat {
        font-size: 12px;
    }

    .pay-form-area__label {
        font-size: 11px;
    }

    .pay-form-area__row {
        margin-bottom: 14px;
    }

    .pay-link-amount {
        font-size: 30px;
    }

    .pay-link-details {
        padding: 16px 16px 4px;
    }

    .pay-link-details__label {
        font-size: 11px;
    }

    .pay-link-details__value {
        font-size: 13px;
    }

    .pay-success {
        padding: 28px 16px;
    }

    .pay-success__icon {
        font-size: 44px;
    }

    .pay-success__title {
        font-size: 18px;
    }

    input.pay-amount {
        font-size: 22px;
        padding: 10px 12px 10px 34px;
    }

    .amount-input-wrap {
        max-width: 170px;
    }

    .amount-input-wrap::before {
        font-size: 18px;
        left: 12px;
    }

    textarea.pay-comments {
        padding: 12px 14px;
    }

    input.pay-field {
        padding: 10px 12px;
    }

    .pay-select {
        padding: 10px 38px 10px 12px;
    }

    a.pay-btn,
    a.pay-btn:link,
    a.pay-btn:visited {
        font-size: 15px;
        padding: 13px 20px;
    }
}

/* Very small phones */
@media (max-width: 340px) {
    .pay-card__body {
        padding: 20px 12px 0;
    }

    .pay-form-area {
        padding: 14px 12px 0;
    }

    .pay-section {
        padding: 14px 12px;
    }

    .pay-actions {
        padding: 14px 12px 18px;
    }

    .seller-header__logo img {
        width: 86px;
    }

    .seller-header__name {
        font-size: 17px;
    }

    .pay-link-amount {
        font-size: 26px;
    }

    .pay-link-details {
        padding: 12px 12px 4px;
    }

    input.pay-amount {
        font-size: 20px;
        padding: 10px 10px 10px 30px;
    }

    .amount-input-wrap::before {
        font-size: 16px;
        left: 10px;
    }
}
