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

:root {
    --primary: #0033CC;
    --primary-dark: #002299;
    --success: #00AA44;
    --error: #dc3545;
    --text: #1a1a1a;
    --text-light: #666;
    --bg: #f8f9fa;
    --card-bg: #fff;
    --border: #e5e5e5;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
}

/* Header */
.header {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.logo svg {
    height: 36px;
    width: auto;
}

.header-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
}

/* Screens */
.screen {
    display: none;
    flex: 1;
    flex-direction: column;
}

.screen.active {
    display: flex;
}

.screen-content {
    flex: 1;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Icons */
.icon-large {
    width: 72px;
    height: 72px;
    color: var(--primary);
    margin-bottom: 24px;
}

.icon-large svg {
    width: 100%;
    height: 100%;
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    max-width: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
    margin-top: 24px;
}

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

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: transparent;
    color: var(--text-light);
    border: 1px solid var(--border);
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 12px;
    width: 100%;
    max-width: 320px;
}

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

.btn-cancel {
    background: rgba(255,255,255,0.95);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 14px 28px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.btn-confirm {
    background: var(--success);
}

.btn-confirm:hover {
    background: #008836;
}

/* Start screen */
.screen-content h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 8px;
}

.screen-content > p {
    color: var(--text-light);
    margin-bottom: 16px;
    max-width: 280px;
    font-size: 15px;
}

.demo-input {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    width: 100%;
    max-width: 320px;
}

.demo-input p {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 12px;
}

.demo-input input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 8px;
}

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

/* Scanner */
.scanner-container {
    position: relative;
    flex: 1;
    background: #000;
    overflow: hidden;
}

#qr-reader {
    width: 100%;
    height: 100%;
}

#qr-reader video {
    object-fit: cover;
}

.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.scanner-frame {
    width: 250px;
    height: 250px;
    border: 3px solid white;
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.5);
}

/* Loading */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

#loading-status {
    color: var(--text-light);
    font-size: 14px;
}

/* Verified badge */
.verified-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #e8f5e9;
    color: var(--success);
    padding: 8px 14px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 24px;
}

.verified-badge svg {
    width: 18px;
    height: 18px;
}

/* Merchant card */
.merchant-card {
    background: var(--bg);
    padding: 20px;
    border-radius: 4px;
    width: 100%;
    max-width: 320px;
    margin-bottom: 24px;
}

.merchant-card h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.merchant-card p {
    color: var(--text-light);
    font-size: 14px;
}

/* Amount display */
.amount-display {
    margin-bottom: 16px;
}

.amount-display .currency {
    font-size: 18px;
    color: var(--text-light);
    vertical-align: super;
}

.amount-display .amount {
    font-size: 42px;
    font-weight: 600;
    color: var(--text);
}

/* Remittance */
.remittance-info {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 24px;
}

/* Amount entry */
.amount-entry {
    width: 100%;
    max-width: 320px;
    margin-bottom: 24px;
}

.amount-entry label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    text-align: left;
    font-size: 14px;
}

.amount-input-group {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.amount-input-group:focus-within {
    border-color: var(--primary);
}

.currency-label {
    background: var(--bg);
    padding: 14px 16px;
    font-weight: 500;
    color: var(--text-light);
    font-size: 14px;
}

.amount-input-group input {
    flex: 1;
    border: none;
    padding: 14px 16px;
    font-size: 20px;
    font-weight: 600;
    text-align: right;
    outline: none;
}

/* Success */
.success-icon {
    width: 64px;
    height: 64px;
    background: #e8f5e9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.success-icon svg {
    width: 36px;
    height: 36px;
    color: var(--success);
}

.success-message {
    color: var(--text-light);
    max-width: 280px;
    margin-bottom: 24px;
    font-size: 15px;
}

.tech-note {
    background: var(--bg);
    padding: 16px 20px;
    border-radius: 4px;
    text-align: left;
    font-size: 14px;
    width: 100%;
    max-width: 320px;
}

.tech-note p {
    margin-bottom: 8px;
    color: var(--text);
}

.tech-note ul {
    margin-left: 20px;
    color: var(--text-light);
}

.tech-note li {
    margin-bottom: 4px;
}

/* Error */
.error-icon {
    width: 64px;
    height: 64px;
    background: #fce4e4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.error-icon svg {
    width: 36px;
    height: 36px;
    color: var(--error);
}

#error-message {
    color: var(--text-light);
    max-width: 280px;
    font-size: 15px;
}

/* Responsive */
@media (max-width: 480px) {
    .app {
        max-width: 100%;
    }
}
