/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0f1011;
    --primary-hover: #1d4ed8;
    --success-color: #10b981;
    --error-color: #dc2626;
    --warning-color: #dc2626;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
    line-height: 1.6;
}

/* Language Toggle */
.language-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 8px;
    background: var(--bg-white);
    padding: 4px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    z-index: 1000;
}

.lang-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.lang-btn:hover {
    background: var(--bg-light);
}

.lang-btn.active {
    background: var(--primary-color);
    color: white;
}

/* Container */
.container {
    max-width: 600px;
    margin: 40px auto;
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
    padding: 32px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo h1 {
    font-size: 24px;
    font-weight: 600;
}

.security-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

/* Form */
.payment-form {
    padding: 32px;
}

.section {
    margin-bottom: 32px;
}

.section h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--bg-light);
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
    flex: 1;
    min-width: 200px;
}

.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    color: var(--text-primary);
    transition: all 0.2s ease;
    background: var(--bg-white);
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input[type="text"]:invalid:not(:placeholder-shown),
input[type="number"]:invalid:not(:placeholder-shown),
select:invalid:not(:placeholder-shown) {
    border-color: var(--error-color);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

/* Amount Input */
.amount-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.amount-input-wrapper input {
    padding-left: 40px;
    padding-right: 60px;
}

.currency-symbol {
    position: absolute;
    left: 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
}

.currency-code {
    position: absolute;
    right: 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-light);
    padding: 4px 8px;
    border-radius: 4px;
}

/* Card Input */
.card-input-wrapper {
    position: relative;
}

.card-input-wrapper input {
    padding-right: 50px;
}

.card-icons {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 4px;
}

/* CVV Wrapper */
.cvv-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.cvv-tooltip {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: help;
}

.cvv-tooltip svg {
    display: block;
}

.tooltip-text {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: var(--text-primary);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 12px;
    border: 6px solid transparent;
    border-top-color: var(--text-primary);
}

.cvv-tooltip:hover .tooltip-text {
    opacity: 1;
}

/* Field Hint */
.field-hint {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
    font-style: italic;
}

/* Info Box */
.info-box {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: #eff6ff;
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    margin-top: 20px;
}

.info-box svg {
    flex-shrink: 0;
    margin-top: 2px;
}

/* Warning Box */
.warning-box {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: #fef2f2;
    border-left: 4px solid var(--warning-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 24px;
}

.warning-box svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.warning-box p {
    margin-bottom: 4px;
}

/* Error Message */
.error-message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #fef2f2;
    border: 2px solid var(--error-color);
    border-radius: 8px;
    color: var(--error-color);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-md);
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--bg-white);
    border-radius: 16px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.success-icon {
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
}

.success-content h2 {
    font-size: 28px;
    color: var(--text-primary);
    margin-bottom: 12px;
    border: none;
    padding: 0;
}

.success-content p {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.confirmation-details {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    text-align: left;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row span {
    color: var(--text-secondary);
    font-size: 14px;
}

.detail-row strong {
    color: var(--text-primary);
    font-size: 16px;
}

.close-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: var(--primary-hover);
}

/* Footer */
.footer {
    padding: 24px 32px;
    background: var(--bg-light);
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        margin: 20px auto;
    }

    .header {
        padding: 24px;
    }

    .logo h1 {
        font-size: 20px;
    }

    .payment-form {
        padding: 24px;
    }

    .form-row {
        flex-direction: column;
    }

    .language-toggle {
        top: 10px;
        right: 10px;
    }

    .modal-content {
        padding: 32px 24px;
    }

    .success-content h2 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
    }

    .security-badge {
        width: 100%;
        justify-content: center;
    }

    .payment-form {
        padding: 20px;
    }

    .section h2 {
        font-size: 16px;
    }

    input[type="text"],
    input[type="number"],
    select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }

    .language-toggle,
    .submit-btn,
    .warning-box {
        display: none;
    }

    .container {
        box-shadow: none;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    input[type="text"],
    input[type="number"],
    select {
        border-width: 3px;
    }

    .submit-btn {
        border: 3px solid white;
    }
}

