/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

:root {
    --red: #b22234;
    --white: #ffffff;
    --blue: #3c3b6e;
    --light-blue: #5a5a9e;
    --dark-blue: #1a1a3e;
    --gray: #f5f5f5;
    --text-dark: #1a1a2e;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--blue) 0%, var(--dark-blue) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(90deg, var(--red) 0%, var(--red) 10%, transparent 10%, transparent 90%, var(--red) 90%, var(--red) 100%),
        linear-gradient(0deg, var(--white) 0%, var(--white) 100%);
    background-size: 100% 6px, 100% 100%;
    opacity: 0.03;
    z-index: 0;
}

.card {
    position: relative;
    z-index: 1;
    max-width: 540px;
    width: 100%;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 2.5rem 2rem 2rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

/* ===== HEADER ===== */
.app-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--red);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 0.3rem;
}

.logo-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--red), var(--blue));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--white);
    box-shadow: 0 4px 12px rgba(178, 34, 52, 0.3);
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--red), var(--blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.logo h1 span {
    font-weight: 300;
    -webkit-text-fill-color: var(--red);
}

.sub-header {
    color: var(--blue);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.sub-header i {
    color: var(--red);
    margin: 0 4px;
}

.est-year {
    display: inline-block;
    background: var(--red);
    color: var(--white);
    padding: 0.1rem 0.8rem;
    border-radius: 20px;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-top: 0.3rem;
}

.flag-stripes {
    display: flex;
    gap: 0;
    height: 4px;
    margin: 0.8rem 0 0;
    border-radius: 4px;
    overflow: hidden;
}

.flag-stripes .stripe {
    flex: 1;
    height: 100%;
}

.flag-stripes .stripe:nth-child(odd) {
    background: var(--red);
}

.flag-stripes .stripe:nth-child(even) {
    background: var(--white);
}

/* ===== FORM ===== */
.form-group {
    margin-bottom: 1.2rem;
}

.form-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--blue);
    margin-bottom: 0.4rem;
}

.form-label .required {
    color: var(--red);
    font-size: 0.6rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--white);
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    transition: all 0.25s ease;
    overflow: hidden;
}

.input-wrapper:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(60, 59, 110, 0.1);
}

.input-wrapper .input-icon {
    padding: 0 0 0 1rem;
    color: var(--blue);
    font-size: 0.9rem;
    opacity: 0.6;
}

.input-wrapper input {
    width: 100%;
    background: transparent;
    border: none;
    padding: 0.85rem 1rem;
    color: var(--text-dark);
    font-size: 0.95rem;
    outline: none;
}

.input-wrapper input::placeholder {
    color: #aaa;
}

.input-hint {
    font-size: 0.7rem;
    color: #888;
    margin-top: 0.3rem;
    padding-left: 0.5rem;
}

.input-hint i {
    color: var(--blue);
    margin-right: 4px;
}

/* ===== PAYMENT METHOD CARDS ===== */
.payment-options {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin: 0.5rem 0 0.5rem;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0.9rem 1.2rem;
    background: var(--white);
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
}

.payment-option:hover {
    border-color: var(--blue);
    background: #f8f8ff;
}

.payment-option.selected {
    border-color: var(--blue);
    background: #f0f0ff;
    box-shadow: 0 0 0 4px rgba(60, 59, 110, 0.08);
}

.payment-option input[type="radio"] {
    display: none;
}

.payment-option .radio-circle {
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
}

.payment-option.selected .radio-circle {
    border-color: var(--blue);
    background: var(--blue);
}

.payment-option.selected .radio-circle::after {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--white);
    border-radius: 50%;
}

.payment-option .method-icon {
    font-size: 1.5rem;
    width: 32px;
    text-align: center;
}

.payment-option .method-info {
    flex: 1;
}

.payment-option .method-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.payment-option .method-desc {
    font-size: 0.75rem;
    color: #888;
}

.payment-option .method-badge {
    font-size: 0.6rem;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* ===== SUBMIT BUTTON ===== */
.action-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--white);
    background: linear-gradient(135deg, var(--red), var(--blue));
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(178, 34, 52, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 0.5rem;
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s;
}

.action-btn:hover:not(:disabled)::before {
    left: 100%;
}

.action-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(178, 34, 52, 0.4);
}

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

.action-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.action-btn .btn-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.action-btn .spinner {
    display: none;
    width: 22px;
    height: 22px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.action-btn.loading .btn-text {
    display: none;
}

.action-btn.loading .spinner {
    display: block;
}

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

/* ===== LOADING OVERLAY ===== */
.loading-overlay {
    display: none;
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: rgba(60, 59, 110, 0.04);
    border-radius: 16px;
    border: 1px solid rgba(60, 59, 110, 0.08);
    text-align: center;
}

.loading-overlay.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.loading-overlay .loader {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(60, 59, 110, 0.1);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

.loading-overlay .loader-text {
    color: var(--blue);
    font-size: 0.95rem;
    font-weight: 500;
}

.loading-overlay .loader-sub {
    color: #888;
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

.loading-overlay .progress-bar {
    width: 100%;
    height: 3px;
    background: rgba(60, 59, 110, 0.1);
    border-radius: 4px;
    margin-top: 1rem;
    overflow: hidden;
}

.loading-overlay .progress-bar .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--red), var(--blue));
    border-radius: 4px;
    width: 0%;
    animation: progress 2.5s ease-in-out forwards;
}

@keyframes progress {
    0% { width: 0%; }
    20% { width: 15%; }
    40% { width: 35%; }
    60% { width: 65%; }
    80% { width: 85%; }
    95% { width: 95%; }
    100% { width: 100%; }
}

/* ===== ALERT ===== */
.alert {
    padding: 0.8rem 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error {
    background: #fee;
    color: var(--red);
    border: 1px solid #fcc;
}

.alert-error i {
    color: var(--red);
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.alert-success i {
    color: #2e7d32;
}

.alert-warning {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffe0b2;
}

.alert-warning i {
    color: #e65100;
}

/* ===== STAMP DUTY PAGE ===== */
.stamp-duty-box {
    background: linear-gradient(135deg, #fff3e0, #fff8e1);
    border: 2px solid #ffc107;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0 1.5rem;
    text-align: center;
}

.stamp-duty-box .stamp-icon {
    font-size: 2.5rem;
    color: #f57c00;
    margin-bottom: 0.5rem;
}

.stamp-duty-box .stamp-amount {
    font-size: 2rem;
    font-weight: 700;
    color: #e65100;
}

.stamp-duty-box .stamp-text {
    color: #666;
    font-size: 0.95rem;
    margin-top: 0.3rem;
}

.stamp-duty-box .stamp-note {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px dashed #e8e8e8;
}

.stamp-code-input {
    margin: 1.5rem 0;
}

.stamp-code-input .input-wrapper {
    background: #fff8e1;
    border-color: #ffc107;
}

.stamp-code-input .input-wrapper:focus-within {
    border-color: #f57c00;
    box-shadow: 0 0 0 4px rgba(245, 124, 0, 0.1);
}

/* ===== RESULT PAGE ===== */
.result-icon {
    font-size: 4.5rem;
    margin: 1rem 0;
}

.result-status {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.result-status.approved { color: #2e7d32; }
.result-status.failed { color: #b22234; }
.result-status.pending { color: #f57c00; }

.result-message {
    color: #555;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.result-details {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.2rem;
    margin: 1.2rem 0;
    text-align: left;
}

.result-details .detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid #e8e8e8;
    font-size: 0.9rem;
}

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

.result-details .detail-label {
    color: #666;
    font-weight: 500;
}

.result-details .detail-value {
    color: #1a1a2e;
    font-weight: 600;
}

.transaction-id {
    font-family: monospace;
    background: #e8e8e8;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.result-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.result-actions .btn-primary,
.result-actions .btn-secondary {
    flex: 1;
    padding: 0.8rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    text-decoration: none;
    font-size: 0.9rem;
}

.result-actions .btn-primary {
    background: linear-gradient(135deg, var(--red), var(--blue));
    color: white;
    border: none;
}

.result-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(178, 34, 52, 0.3);
}

.result-actions .btn-secondary {
    background: transparent;
    color: #3c3b6e;
    border: 2px solid #3c3b6e;
}

.result-actions .btn-secondary:hover {
    background: #3c3b6e;
    color: white;
}

/* ===== BACK BUTTON ===== */
.back-link {
    display: inline-block;
    color: var(--blue);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    padding: 0.3rem 0.8rem;
    border-radius: 8px;
    transition: background 0.3s;
}

.back-link:hover {
    background: rgba(60, 59, 110, 0.08);
}

.back-link i {
    margin-right: 6px;
}

/* ===== FOOTER ===== */
.footer {
    margin-top: 2rem;
    padding-top: 1.2rem;
    border-top: 1px solid #e8e8e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.footer .left {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #888;
    font-size: 0.65rem;
}

.footer .left i {
    color: var(--red);
}

.footer .right {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #888;
    font-size: 0.6rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .card {
        padding: 1.5rem 1rem 1.2rem;
        margin: 0.5rem;
    }
    
    .logo h1 {
        font-size: 1.4rem;
    }
    
    .logo-icon {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }
}
