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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #333;
}

.container {
    width: 100%;
    max-width: 420px;
}

/* 화면 전환 */
.screen {
    display: none;
}

.screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

/* 카드 */
.card {
    background: #fff;
    border-radius: 20px;
    padding: 40px 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    text-align: center;
    width: 100%;
    animation: slideUp 0.4s ease-out;
}

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

/* 아이콘 */
.icon-wrapper {
    margin-bottom: 20px;
}

.app-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 제목 */
h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1a1a1a;
}

h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

/* 가맹점 정보 */
.merchant-info {
    background: #f0f4ff;
    border-radius: 12px;
    padding: 14px 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.merchant-info .label {
    font-size: 14px;
    color: #666;
}

.merchant-info .value {
    font-size: 16px;
    font-weight: 600;
    color: #1a73e8;
}

/* 설명 텍스트 */
.description {
    font-size: 15px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 28px;
}

/* 버튼 */
.btn-primary {
    width: 100%;
    padding: 16px;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #1a73e8, #4285f4);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 4px 16px rgba(26, 115, 232, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 115, 232, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    color: #1a73e8;
    background: #f0f4ff;
    border: 2px solid #1a73e8;
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-secondary:hover {
    background: #e0e8ff;
}

/* 힌트 텍스트 */
.hint {
    font-size: 12px;
    color: #999;
    margin-top: 12px;
}

/* 로딩 스피너 */
.spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #e0e0e0;
    border-top: 4px solid #1a73e8;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

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

.loading-text,
.processing-text {
    font-size: 16px;
    color: #fff;
}

.processing-text {
    color: #555;
}

/* 성공/오류 아이콘 */
.success-icon,
.error-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.timer-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: #fff3e0;
    border: 1px solid #ffcc02;
    border-radius: 10px;
    padding: 10px 16px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #e65100;
    font-weight: 500;
}

.timer-box.expired {
    background: #ffebee;
    border-color: #ef5350;
    color: #c62828;
}

.timer-icon {
    font-size: 18px;
}

.timer-value {
    font-weight: 700;
    font-size: 16px;
    font-variant-numeric: tabular-nums;
    min-width: 48px;
    text-align: center;
}

.info-box {
    background: #f5f5f5;
    border-left: 4px solid #1a73e8;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
    text-align: left;
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

.info-box p strong {
    color: #333;
}

/* iOS 설치 가이드 */
.install-guide {
    margin-top: 20px;
    text-align: center;
}

.install-guide hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 20px 0;
}

.install-guide p {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
}

.badge-hint {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 10px;
    background: #ff3b30;
    color: #fff;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

/* 이름 입력 필드 */
.input-group {
    text-align: left;
    margin-bottom: 20px;
}

.input-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.input-label .required {
    color: #ff3b30;
}

.input-field {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #fafafa;
    color: #333;
}

.input-field:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
    background: #fff;
}

.input-field::placeholder {
    color: #bbb;
}

.input-hint {
    font-size: 12px;
    color: #999;
    margin-top: 6px;
}

/* iOS 홈화면 추가 가이드 */
.ios-guide {
    margin-top: 16px;
    text-align: left;
}

.ios-guide hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 16px 0;
}

.ios-guide h3 {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
    text-align: center;
}

.guide-desc {
    font-size: 13px;
    color: #666;
    text-align: center;
    margin-bottom: 12px;
}

.guide-steps {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 14px 16px;
}

.guide-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 13px;
    color: #444;
    line-height: 1.5;
}

.guide-step + .guide-step {
    border-top: 1px solid #eee;
}

.step-num {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #1a73e8, #4285f4);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.share-icon {
    display: inline-block;
    background: #007aff;
    color: #fff;
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    border-radius: 4px;
    font-size: 14px;
    vertical-align: middle;
}

.arrow-guide-bottom {
    display: flex;
    align-items: flex-end;
    margin-top: 12px;
    padding-bottom: 4px;
}

.arrow-spacer {
    flex: 1;
}

.arrow-pointer {
    text-align: right;
    padding-right: 8px;
}

.arrow-label {
    font-size: 12px;
    color: #007aff;
    font-weight: 600;
}

.bounce-arrow {
    font-size: 28px;
    color: #007aff;
    animation: bounceDown 1.2s ease-in-out infinite;
    margin-top: 2px;
}

@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

/* 수신 내역 */
.history-list {
    text-align: left;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 12px;
}

.history-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    border-left: 4px solid #4CAF50;
}

.history-item .history-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.history-item .history-amount {
    font-size: 18px;
    font-weight: 700;
    color: #1a73e8;
    margin-bottom: 4px;
}

.history-item .history-time {
    font-size: 12px;
    color: #999;
}

.history-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

/* 반응형 */
@media (max-width: 360px) {
    .card {
        padding: 30px 20px;
    }

    h1 {
        font-size: 20px;
    }

    .btn-primary {
        font-size: 16px;
        padding: 14px;
    }
}
