:root {
    --color-nexi-blue: #2d32aa;
    --color-nexi-purple: #6b46c1;
    --color-nexi-green: #059669;
    --color-nexi-orange: #f97316;
    --color-nexi-dark-blue: #212861;

    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-500: #64748b;
    --gray-700: #334155;
    --gray-900: #0f172a;

    --text: var(--color-nexi-dark-blue);
    --text-muted: var(--gray-500);
    --border: var(--gray-200);
    --border-strong: var(--gray-300);
    --surface: var(--white);
    --surface-muted: var(--gray-50);
    --danger: var(--color-nexi-orange);
    --success: var(--color-nexi-green);
    --primary: var(--color-nexi-blue);
    --primary-strong: var(--color-nexi-dark-blue);
    --accent: var(--color-nexi-purple);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    background: var(--white);
    color: var(--text);
    font-family:
            Inter,
            ui-sans-serif,
            system-ui,
            -apple-system,
            BlinkMacSystemFont,
            "Segoe UI",
            Roboto,
            sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    padding: 0;
}

form#cardForm {
    width: 100%;
    margin: 0;
    padding: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    background: var(--surface);
}

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

.field:nth-child(1) {
    width: 100%;
}

.field:nth-child(2),
.field:nth-child(3) {
    width: calc(50% - 6px);
}

.field-btn {
    width: 100%;
    margin-top: 4px;
}

.field-label {
    font-size: 13px;
    line-height: 1.4;
    font-weight: 600;
    color: var(--text);
    padding-left: 2px;
}

input {
    width: 100%;
    margin: 0;
    font: inherit;
    border: 0;
    outline: none;
    border-radius: 14px;
}

input[type="tel"] {
    height: 56px;
    padding: 0 16px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    color: var(--gray-900);
    font-size: 16px;
    line-height: 1;
    appearance: none;
    -webkit-appearance: none;
}

input[type="tel"]::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

#CardNumber {
    font-size: 18px;
    letter-spacing: 0.02em;
}

input[type="tel"]:focus {
    background: var(--white);
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

input[type="submit"] {
    height: 56px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(
            135deg,
            var(--color-nexi-blue) 0%,
            var(--color-nexi-purple) 100%
    );
    color: var(--white);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

input[type="submit"]:disabled {
    background: var(--gray-300);
    color: var(--white);
    cursor: not-allowed;
}

span[id$="FieldValidation"] {
    display: block;
    min-height: 18px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--danger);
    padding-left: 2px;
}

.maxCards {
    width: 100%;
    margin: 0;
    padding: 0 16px 16px;
}

#maxCards {
    display: block;
    width: 100%;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-muted);
    text-align: center;
}

@media (max-width: 480px) {
    form#cardForm {
        padding: 14px;
        gap: 10px;
    }

    .field:nth-child(2),
    .field:nth-child(3) {
        width: calc(50% - 5px);
    }

    input[type="tel"],
    input[type="submit"] {
        height: 54px;
    }

    #CardNumber {
        font-size: 17px;
    }

    .maxCards {
        padding: 0 14px 14px;
    }
}

#generalError {
    display: none;
    width: 100%;
    min-height: 20px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--danger);
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    padding: 10px 12px;
}

#generalError:not(:empty) {
    display: block;
}