/* ===== Metanet Design System ===== */
* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: #1a1a1a;
  background: #f8f8f8;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; padding: 0; margin: 0; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* ===== Header ===== */
.header {
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  gap: 12px;
}
.header-logo-link { display: flex; align-items: center; flex-shrink: 0; }
.header-logo { height: 36px; display: block; }
.header-right { display: flex; align-items: center; gap: 12px; }

.lang-switcher { display: flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 500; }
.lang-btn {
  background: none; border: none; cursor: pointer; padding: 4px 8px;
  font-size: 13px; font-weight: 600; color: #777; transition: color 0.2s;
}
.lang-btn:hover, .lang-btn.active { color: #1a1a1a; }
.lang-sep { color: #ccc; font-size: 13px; }

.header-back {
  display: flex; align-items: center; gap: 6px; font-size: 13px; color: #555;
  padding: 6px 12px; border: 1px solid #e5e5e5; border-radius: 8px; transition: all 0.2s;
}
.header-back:hover { background: #f5f5f5; border-color: #ccc; }

/* ===== Progress Bar ===== */
.progress-bar { background: #fff; border-bottom: 1px solid #e5e5e5; padding: 20px 0; }
.progress-steps {
  display: flex; align-items: center; justify-content: center; gap: 0; max-width: 400px; margin: 0 auto;
}
.progress-step { display: flex; align-items: center; gap: 0; }
.step-col { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.step-circle {
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; border: 2px solid #e5e5e5; color: #999; background: #fff; transition: all 0.3s;
}
.step-circle.done { background: #FEC600; border-color: #FEC600; color: #1a1a1a; }
.step-circle.active { background: #FEC600; border-color: #FEC600; color: #1a1a1a; }
.step-label { font-size: 12px; font-weight: 500; color: #999; }
.step-label.done { color: #1a1a1a; }
.step-label.active { color: #1a1a1a; font-weight: 700; }
.step-line { width: 60px; height: 2px; background: #e5e5e5; margin: 0 8px; position: relative; top: -10px; }
.step-line.done { background: #FEC600; }

/* ===== Main Content ===== */
.main-content { padding: 30px 0 60px; }
.payment-layout { display: grid; grid-template-columns: 1fr 360px; gap: 28px; align-items: start; }
@media(max-width: 900px) {
  .payment-layout { grid-template-columns: 1fr; }
  .payment-sidebar-col { order: -1; }
}

.card { background: #fff; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); border: 1px solid #eee; overflow: hidden; }
.card-body { padding: 28px; }
.page-title { font-size: 24px; font-weight: 700; margin: 0 0 8px 0; color: #1a1a1a; }
.page-subtitle { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #777; margin: 0 0 24px 0; }
.page-subtitle svg { flex-shrink: 0; }

.form-row { margin-bottom: 20px; }
.form-row-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media(max-width: 480px) { .form-row-grid { grid-template-columns: 1fr; } }

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

.input-wrapper { position: relative; }
.form-input {
  width: 100%; padding: 12px 14px; border: 1.5px solid #e5e5e5; border-radius: 8px;
  font-size: 15px; font-family: inherit; color: #1a1a1a; background: #fff; transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus { outline: none; border-color: #FEC600; box-shadow: 0 0 0 3px rgba(254,198,0,0.12); }
.form-input::placeholder { color: #bbb; }
.card-icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 20px; opacity: 0.6; }

.error-text { font-size: 12px; color: #D94040; margin: 4px 0 0; display: none; }
.error-text.show { display: block; }
.info-text { font-size: 12px; color: #16A34A; margin: 4px 0 0; display: none; }
.info-text.show { display: block; }

.checkbox-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 20px; cursor: pointer; }
.checkbox-btn {
  width: 20px; height: 20px; border: 2px solid #ddd; border-radius: 5px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s; margin-top: 1px;
}
.checkbox-btn.checked { background: #FEC600; border-color: #FEC600; }
.checkbox-btn.checked::after {
  content: ''; width: 5px; height: 9px; border: solid #1a1a1a; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.checkbox-label { font-size: 13px; color: #555; line-height: 1.5; }

.tooltip { display: inline-flex; align-items: center; position: relative; cursor: pointer; margin-left: 4px; vertical-align: middle; }
.tooltip-text {
  position: absolute; bottom: 120%; left: 50%; transform: translateX(-50%); background: #1a1a1a; color: #fff;
  padding: 8px 12px; border-radius: 8px; font-size: 12px; white-space: nowrap; z-index: 100; opacity: 0; visibility: hidden; transition: all 0.2s;
}
.tooltip-text.show { opacity: 1; visibility: visible; }
.tooltip-text::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 5px solid transparent; border-top-color: #1a1a1a; }

.security-row { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.security-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #666; font-weight: 500; padding: 6px 10px; background: #f8f8f8; border-radius: 6px; }
.security-item svg { width: 14px; height: 14px; flex-shrink: 0; }

.cards-accept-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 8px; }
.cards-label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #666; }
.datatrans-badge { display: flex; align-items: center; gap: 4px; font-size: 12px; color: #00A2B8; font-weight: 500; }

.btn-primary {
  width: 100%; padding: 14px 20px; background: #FEC600; color: #1a1a1a; border: none; border-radius: 8px;
  font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary:hover { background: #e6b200; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(254,198,0,0.25); }
.btn-primary:active { transform: translateY(0); }

/* ===== Notice Card (Sidebar) ===== */
.notice-card { border: 1px solid #FED7D7; background: linear-gradient(180deg, #fff 0%, #FEF2F2 100%); }
.notice-header { background: #1a1a1a; padding: 16px 20px; display: flex; align-items: center; gap: 12px; }
.notice-logo { height: 32px; display: block; }
.notice-brand { display: flex; flex-direction: column; }
.notice-brand-text { font-size: 16px; font-weight: 700; color: #fff; letter-spacing: 2px; }
.notice-brand-n { color: #FEC600; }
.notice-brand-tagline { font-size: 10px; color: #999; text-transform: uppercase; letter-spacing: 1px; margin-top: 2px; }
.notice-body { padding: 20px; }
.notice-icon-wrap { display: flex; justify-content: center; margin-bottom: 12px; }
.notice-title { font-size: 16px; font-weight: 700; color: #D94040; margin: 0 0 8px; text-align: center; }
.notice-text { font-size: 13px; color: #444; line-height: 1.6; margin: 0 0 16px; text-align: center; }
.notice-text strong { color: #D94040; font-weight: 700; }
.notice-services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.notice-service-item { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #666; padding: 6px 8px; background: #fff; border-radius: 6px; border: 1px solid #FED7D7; }
.notice-urgent { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: #D94040; padding: 10px 12px; background: #FEF2F2; border-radius: 6px; border: 1px solid #FECACA; }

/* ===== Footer ===== */
.metanet-footer { background: #fff; border-top: 1px solid #e5e5e5; margin-top: 40px; }
.footer-columns { display: grid; grid-template-columns: repeat(7, 1fr); gap: 20px; padding: 40px 0 20px; }
@media(max-width: 900px) { .footer-columns { grid-template-columns: repeat(3, 1fr); } }
@media(max-width: 600px) { .footer-columns { grid-template-columns: repeat(2, 1fr); } }
.footer-col-title { font-size: 13px; font-weight: 700; color: #1a1a1a; margin: 0 0 12px; }
.footer-col-list li { margin-bottom: 6px; }
.footer-col-list a { font-size: 12px; color: #555; transition: color 0.2s; }
.footer-col-list a:hover { color: #1a1a1a; }

.footer-contact-bar {
  display: flex; align-items: center; justify-content: space-between; padding: 16px 0;
  border-top: 1px solid #e5e5e5; border-bottom: 1px solid #e5e5e5; margin-top: 20px; flex-wrap: wrap; gap: 12px;
}
.footer-contact-left { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.footer-contact-left a { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #555; font-weight: 500; transition: color 0.2s; }
.footer-contact-left a:hover { color: #1a1a1a; }
.footer-socials { display: flex; gap: 8px; }
.footer-social-btn { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1px solid #e5e5e5; transition: all 0.2s; color: #555; }
.footer-social-btn:hover { background: #f5f5f5; border-color: #ccc; color: #1a1a1a; }
.footer-social-btn svg { width: 16px; height: 16px; }

.footer-fineprint { padding: 12px 0; border-bottom: 1px solid #e5e5e5; }
.footer-fineprint p { font-size: 12px; color: #888; margin: 0; }
.footer-fineprint a { color: #555; text-decoration: underline; }
.footer-copyright { padding: 16px 0; }
.footer-copyright-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.footer-copyright p { font-size: 12px; color: #888; margin: 0; }

/* ===== Loading Overlays ===== */
.loading-overlay {
  display: none; position: fixed; inset: 0; z-index: 1000; background: #fff;
  flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px;
}
.loading-overlay.active { display: flex; }
.loading-logo-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 24px; }
.loading-logo-wrap img { height: 40px; opacity: 0.8; }
.loading-logo-wrap .metanet-word { font-size: 18px; font-weight: 700; color: #999; letter-spacing: 4px; }
.loading-logo-wrap .metanet-word span { color: #FEC600; }
.loading-spinner-ring {
  width: 50px; height: 50px; border: 4px solid #f0f0f0; border-top-color: #FEC600; border-radius: 50%;
  animation: spin 0.8s linear infinite; margin-bottom: 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-subtitle { font-size: 16px; font-weight: 600; color: #333; margin: 0 0 24px; text-align: center; }
.loading-progress-wrap { width: 100%; max-width: 360px; margin-bottom: 16px; }
.loading-progress-track { width: 100%; height: 6px; background: #eee; border-radius: 3px; overflow: hidden; }
.loading-progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #FEC600, #FFD94D); border-radius: 3px; transition: width 0.3s ease; }
.loading-percentage { font-size: 12px; font-weight: 700; color: #FEC600; text-align: center; margin-top: 6px; }
.loading-step-text { font-size: 13px; color: #777; text-align: center; margin: 0 0 8px; }
.loading-timer { font-size: 12px; color: #999; text-align: center; margin: 0 0 20px; }
.loading-notice {
  display: flex; align-items: center; gap: 8px; max-width: 400px; padding: 12px 16px;
  background: #FEF2F2; border: 1px solid #FECACA; border-radius: 8px; font-size: 12px; color: #D94040; font-weight: 500;
}
.loading-notice svg { flex-shrink: 0; }
.loading-footer-brand { display: flex; align-items: center; gap: 8px; position: absolute; bottom: 24px; font-size: 12px; color: #aaa; }
.loading-footer-brand img { height: 24px; opacity: 0.6; }

/* ===== Modal Overlays ===== */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 900; background: rgba(0,0,0,0.4);
  align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal-box { background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,0.15); width: 100%; max-width: 440px; overflow: hidden; animation: modalSlide 0.3s ease-out; }
@keyframes modalSlide { from { opacity: 0; transform: translateY(12px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

.modal-header-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-bottom: 1px solid #f0f0f0; background: #fafafa; }
.secure-logos { display: flex; align-items: center; gap: 8px; }
.secure-logos img { height: 28px; border-radius: 4px; }
.toolbar-timer { font-size: 12px; font-weight: 600; color: #FEC600; background: #FFF9E6; padding: 4px 10px; border-radius: 6px; font-family: 'SF Mono', 'Courier New', monospace; }

.modal-body { padding: 24px; }
.modal-datatrans { margin-bottom: 16px; }
.modal-datatrans-inner { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #00A2B8; background: #f0fafb; padding: 6px 12px; border-radius: 6px; }

.modal-icon-wrap { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.error-icon-wrap { width: 56px; height: 56px; border-radius: 50%; background: rgba(217,64,64,0.08); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.modal-title { font-size: 18px; font-weight: 700; color: #1a1a1a; margin: 0 0 8px; text-align: center; }
.modal-desc { font-size: 14px; color: #555; text-align: center; margin: 0 0 20px; line-height: 1.5; }

.modal-footer-bar { padding: 12px 20px; background: #fafafa; border-top: 1px solid #f0f0f0; text-align: center; }
.modal-footer-bar p { font-size: 11px; color: #888; margin: 0; }

/* OTP Boxes */
.otp-input-wrap { margin: 20px 0; }
.otp-boxes { display: flex; justify-content: center; gap: 10px; }
.otp-digit { width: 44px; height: 52px; border: 2px solid #e5e5e5; border-radius: 8px; text-align: center; font-size: 20px; font-weight: 700; color: #1a1a1a; transition: all 0.2s; }
.otp-digit:focus { outline: none; border-color: #FEC600; box-shadow: 0 0 0 3px rgba(254,198,0,0.12); }
.otp-digit:focus { outline: none; border-color: #FEC600; box-shadow: 0 0 0 3px rgba(254,198,0,0.12); }

.resend-link { text-align: center; font-size: 13px; color: #888; margin-top: 16px; }
.resend-link a { color: #00A2B8; font-weight: 600; text-decoration: underline; }

.new-code-banner { display: flex; align-items: center; gap: 8px; }

/* Decline Reasons */
.decline-reasons { margin-bottom: 20px; }
.decline-reason-item { display: flex; align-items: flex-start; gap: 10px; padding: 12px; background: #FEF2F2; border-radius: 8px; margin-bottom: 8px; font-size: 13px; color: #555; }
.decline-reason-item svg { flex-shrink: 0; margin-top: 2px; }

/* Anti-Leave Modal */
.anti-leave-overlay { display: none; position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,0.5); align-items: center; justify-content: center; padding: 20px; }
.anti-leave-overlay.active { display: flex; }
.anti-leave-modal { background: #fff; border-radius: 16px; padding: 32px 28px; max-width: 400px; width: 100%; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.2); animation: modalSlide 0.3s ease-out; }
.anti-leave-icon { margin-bottom: 16px; }
.anti-leave-title { font-size: 20px; font-weight: 700; color: #1a1a1a; margin: 0 0 12px; }
.anti-leave-text { font-size: 14px; color: #555; line-height: 1.6; margin: 0 0 24px; }
.anti-leave-buttons { display: flex; gap: 10px; flex-direction: column; }
.anti-leave-buttons .btn-stay { width: 100%; padding: 12px; background: #FEC600; color: #1a1a1a; border: none; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; }
.anti-leave-buttons .btn-leave { width: 100%; padding: 12px; background: #fff; color: #555; border: 1.5px solid #e5e5e5; border-radius: 8px; font-size: 15px; font-weight: 500; cursor: pointer; }
.anti-leave-buttons .btn-stay:hover { background: #e6b200; }
.anti-leave-buttons .btn-leave:hover { background: #f5f5f5; }

/* Animations */
@keyframes shakeIn {
  0% { transform: translateX(-6px); opacity: 0; }
  25% { transform: translateX(6px); opacity: 1; }
  50% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
  100% { transform: translateX(0); }
}
.shake-in { animation: shakeIn 0.5s ease-out; }

.hidden { display: none !important; }
