/* ===========================
   Global Styles
   =========================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0066cc;
    --primary-hover: #0052a3;
    --success-color: #28a745;
    --error-color: #dc3545;
    --text-color: #333;
    --text-light: #666;
    --border-color: #ddd;
    --bg-light: #f8f9fa;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===========================
   Container & Layout
   =========================== */

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ===========================
   Header
   =========================== */

.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
}

.header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* ===========================
   Main Content
   =========================== */

.main-content {
    flex: 1;
}

/* ===========================
   Payment Form
   =========================== */

.payment-form {
    background: white;
    border-radius: 8px;
    padding: 40px;
    box-shadow: var(--shadow);
}

.form-section {
    margin-bottom: 35px;
}

.form-section h2 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group input.error {
    border-color: var(--error-color);
}

.input-with-prefix {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-prefix .prefix {
    position: absolute;
    left: 15px;
    font-size: 1rem;
    color: var(--text-light);
    font-weight: 600;
    pointer-events: none;
}

.input-with-prefix input {
    padding-left: 35px;
}

.field-error {
    display: block;
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 5px;
    min-height: 20px;
}

.form-error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
    font-size: 0.95rem;
}

/* ===========================
   Calculation Display
   =========================== */

.calculation-display {
    background-color: var(--bg-light);
    border-radius: 6px;
    padding: 20px;
    margin-top: 20px;
}

.calculation-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 1rem;
}

.calculation-row.total {
    margin-top: 10px;
    padding-top: 15px;
    border-top: 2px solid var(--border-color);
    font-size: 1.2rem;
    font-weight: 600;
}

.calculation-row .label {
    color: var(--text-light);
}

.calculation-row .value {
    font-weight: 600;
    color: var(--primary-color);
}

.calculation-row.total .value {
    font-size: 1.4rem;
}

/* ===========================
   Buttons
   =========================== */

.submit-button {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background-color: var(--primary-color);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    margin-top: 10px;
}

.submit-button:hover:not(:disabled) {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

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

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

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

.security-note {
    text-align: center;
    margin-top: 20px;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ===========================
   Result Pages
   =========================== */

.result-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.result-card {
    background: white;
    border-radius: 8px;
    padding: 50px;
    box-shadow: var(--shadow);
    text-align: center;
    max-width: 600px;
    width: 100%;
}

.result-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.result-card.success .result-icon {
    background-color: var(--success-color);
    color: white;
}

.result-card.cancel .result-icon {
    background-color: var(--error-color);
    color: white;
}

.result-card h2 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.result-message {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 30px;
}

.result-details {
    background-color: var(--bg-light);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 30px;
    text-align: left;
}

.result-details p {
    margin-bottom: 10px;
}

.session-id {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    background-color: white;
    padding: 5px 10px;
    border-radius: 4px;
    word-break: break-all;
}

.confirmation-text {
    color: var(--success-color);
    font-weight: 600;
}

.result-actions {
    margin-bottom: 30px;
}

.button {
    display: inline-block;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s;
}

.button-primary {
    background-color: var(--primary-color);
    color: white;
}

.button-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
}

.help-text {
    text-align: left;
    color: var(--text-light);
    font-size: 0.95rem;
}

.help-text ul {
    list-style-position: inside;
    margin-top: 10px;
}

.help-text li {
    margin-bottom: 5px;
}

/* ===========================
   Footer
   =========================== */

.footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ===========================
   Responsive Design
   =========================== */

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .payment-form {
        padding: 25px;
    }

    .result-card {
        padding: 30px 20px;
    }

    .result-icon {
        font-size: 3rem;
        width: 60px;
        height: 60px;
    }

    .result-card h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .payment-form {
        padding: 20px;
    }

    .calculation-row.total {
        font-size: 1.1rem;
    }

    .calculation-row.total .value {
        font-size: 1.2rem;
    }
}
