/* ==================== COMPONENTS ==================== */

/* ==================== BUTTONS ==================== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 14px;
    font-size: 0.9375rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

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

.btn-primary.btn-large {
    padding: 16px 36px;
    font-size: 1rem;
    min-width: 240px;
}

.btn-primary.btn-full {
    width: 100%;
}

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

.btn-primary.btn-premium {
    background: var(--gradient-primary);
    box-shadow: var(--shadow-sm), var(--shadow-glow);
}

.btn-arrow {
    transition: transform 0.2s ease;
}

.btn-primary:hover .btn-arrow {
    transform: translateX(3px);
}

/* Icon Button */
.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

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

.btn-icon .material-icons-round {
    font-size: 20px;
}

/* Back Button */
.btn-back {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 10;
}

/* Secondary Button */
.btn-secondary {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    color: var(--text-secondary);
    padding: 14px;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 12px;
}

.btn-secondary:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

/* ==================== GATEWAY SCREEN ==================== */
.gateway-wrapper {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px 24px;
    position: relative;
    overflow: hidden;
}

.gateway-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.2;
    pointer-events: none;
}

.orb-1 {
    width: 300px;
    height: 300px;
    background: var(--accent-primary);
    top: -80px;
    left: -80px;
}

.orb-2 {
    width: 250px;
    height: 250px;
    background: var(--accent-secondary);
    bottom: -60px;
    right: -60px;
}

.gateway-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    max-width: 400px;
    width: 100%;
    z-index: 1;
}

/* Shield Container */
.shield-container {
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shield-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid transparent;
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.shield-ring-2 {
    width: 80%;
    height: 80%;
    border-top-color: var(--accent-secondary);
    animation-duration: 2s;
    animation-direction: reverse;
}

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

.shield-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.shield-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

.gateway-loading h2 {
    font-size: 1.25rem;
    font-weight: 800;
    text-align: center;
}

.gateway-subtitle {
    color: var(--text-secondary);
    text-align: center;
    font-size: 0.8125rem;
    margin-top: -16px;
}

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-bar-track {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 100px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 100px;
    width: 0%;
    transition: width 0.5s ease;
}

.progress-percentage {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--accent-primary);
    min-width: 40px;
    text-align: right;
}

/* Gateway Steps */
.gateway-steps {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gateway-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    opacity: 0.4;
    transition: all 0.3s ease;
}

.gateway-step.active {
    opacity: 1;
    border-color: var(--accent-primary);
    background: var(--accent-primary-light);
}

.gateway-step.completed {
    opacity: 1;
    border-color: var(--success);
    background: var(--success-light);
}

.step-indicator {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gateway-step.active .step-indicator {
    background: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.gateway-step.completed .step-indicator {
    background: var(--success);
}

.step-icon {
    font-size: 18px;
    color: var(--text-secondary);
}

.gateway-step.active .step-icon,
.gateway-step.completed .step-icon {
    color: white;
}

.gateway-step.completed .step-icon::before {
    content: 'check';
}

.step-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.step-title {
    font-size: 0.8125rem;
    font-weight: 600;
}

.step-description {
    font-size: 0.6875rem;
    color: var(--text-secondary);
}

/* Status Banner */
.status-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.status-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-primary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    flex-shrink: 0;
}

/* Gateway Ready State */
.gateway-ready {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    max-width: 400px;
    width: 100%;
    z-index: 1;
}

.success-animation {
    width: 100px;
    height: 100px;
}

.success-circle {
    width: 100%;
    height: 100%;
}

.success-checkmark {
    width: 100%;
    height: 100%;
    animation: scale-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.success-circle-bg {
    stroke: var(--success);
    stroke-width: 2;
    fill: none;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: circle-draw 0.6s ease-out forwards;
}

.success-check {
    stroke: var(--success);
    stroke-width: 3;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: check-draw 0.3s 0.6s ease-out forwards;
}

@keyframes scale-in {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

@keyframes circle-draw {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes check-draw {
    to {
        stroke-dashoffset: 0;
    }
}

.gateway-ready h2 {
    font-size: 1.375rem;
    font-weight: 800;
    text-align: center;
}

.ready-subtitle {
    color: var(--text-secondary);
    text-align: center;
    margin-top: -16px;
    font-size: 0.875rem;
}

/* File Info Card */
.file-info-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    width: 100%;
}

.file-icon-wrapper {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #EF4444, #F87171);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-icon-wrapper .material-icons-round {
    font-size: 24px;
    color: white;
}

.file-details {
    flex: 1;
}

.file-details h3 {
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 4px;
    word-break: break-all;
}

.file-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.6875rem;
    color: var(--text-secondary);
}

.file-divider {
    color: var(--text-muted);
}

.file-status {
    display: flex;
    align-items: center;
    color: var(--success);
}

.file-status .material-icons-round {
    font-size: 24px;
}

.download-notice {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
}

.download-notice .material-icons-round {
    font-size: 16px;
    color: var(--accent-secondary);
}

/* ==================== PREMIUM SCREEN ==================== */
.premium-wrapper {
    min-height: 100vh;
    min-height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: env(safe-area-inset-bottom);
}

.premium-scrollable {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 48px 16px 140px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 100%;
}

.premium-header {
    text-align: center;
    padding: 0 16px;
}

.premium-badge {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #F59E0B, #FBBF24);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.3);
}

.premium-badge .material-icons-round {
    font-size: 28px;
    color: white;
}

.premium-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.premium-header p {
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

/* Plans Carousel - Fixed clipping */
.plans-carousel {
    width: 100%;
    overflow: visible;
    margin: 0;
    padding: 8px 0;
}

.plans-track {
    display: flex;
    gap: 14px;
    padding: 4px 20px;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.plans-track::-webkit-scrollbar {
    display: none;
}

.plan-card {
    flex: 0 0 260px;
    min-width: 260px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-primary);
    border-radius: 18px;
    padding: 18px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: visible;
    height: auto;
    min-height: auto;
    display: flex;
    flex-direction: column;
}

.plan-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.plan-card.selected {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.plan-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--gradient-primary);
    color: white;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
}

.plan-name {
    font-size: 1.125rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.plan-pricing {
    margin-bottom: 14px;
}

.old-price {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin-right: 6px;
}

.current-price {
    font-size: 1.75rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.plan-duration {
    display: block;
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-top: 2px;
}

.plan-features {
    list-style: none;
    margin-bottom: 14px;
}

.plan-features li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.plan-features li .material-icons-round {
    font-size: 16px;
    color: var(--success);
    flex-shrink: 0;
    margin-top: 1px;
}

/* Plan Features Section */
.plan-features-section {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 14px;
    padding: 14px;
}

.plan-features-section h4 {
    font-size: 0.8125rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-primary);
}

.feature-item:last-child {
    border-bottom: none;
}

.feature-item .material-icons-round {
    color: var(--success);
    font-size: 18px;
    flex-shrink: 0;
}

.feature-item span {
    font-size: 0.8125rem;
}

/* Pricing Info */
.pricing-info {
    text-align: center;
    padding: 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 14px;
    width: 100%;
}

.price-display {
    display: flex;
    align-items: baseline;
    gap: 8px;
    justify-content: center;
    margin-bottom: 4px;
}

#old-price {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 1rem;
}

#current-price {
    font-size: 2rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#plan-duration {
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.savings-badge {
    display: inline-block;
    background: var(--success-light);
    color: var(--success);
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.6875rem;
    font-weight: 700;
    margin-top: 8px;
}

/* Sticky Premium Bottom */
.premium-sticky-bottom {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-primary);
    padding: 16px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.trust-section {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.6875rem;
    color: var(--text-secondary);
}

.trust-item .material-icons-round {
    font-size: 16px;
    color: var(--accent-secondary);
}

/* ==================== BOTTOM SHEETS ==================== */
.bottom-sheet {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.bottom-sheet.hidden {
    display: none;
}

.sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.sheet-content {
    position: relative;
    background: var(--bg-secondary);
    border-radius: 20px 20px 0 0;
    padding: 24px 20px;
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: sheet-slide-up 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes sheet-slide-up {
    from {
        opacity: 0;
        transform: translateY(100%);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--border-secondary);
    border-radius: 100px;
    margin: 0 auto 20px;
}

.sheet-content h3 {
    font-size: 1.125rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 20px;
}

/* Payment Options */
.payment-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-primary);
    border-radius: 14px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
    width: 100%;
    text-align: left;
}

.payment-option:hover {
    border-color: var(--accent-primary);
    background: var(--accent-primary-light);
}

.option-icon {
    width: 44px;
    height: 44px;
    background: var(--accent-primary-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.option-icon .material-icons-round {
    font-size: 22px;
    color: var(--accent-primary);
}

.option-content {
    flex: 1;
}

.option-content h4 {
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.option-content p {
    font-size: 0.6875rem;
    color: var(--text-secondary);
}

.option-arrow {
    color: var(--text-muted);
    flex-shrink: 0;
}

/* QR Container */
.qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    margin-bottom: 16px;
}

.qr-code-box {
    background: white;
    padding: 16px;
    border-radius: 14px;
}

#qr-code-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

#qr-code-container canvas,
#qr-code-container img {
    max-width: 180px;
    max-height: 180px;
}

.qr-amount-display {
    text-align: center;
}

.amount-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-bottom: 4px;
}

.amount-value {
    font-size: 1.5rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.qr-instructions {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: var(--info-light);
    border-radius: 12px;
    margin-bottom: 16px;
}

.qr-instructions .material-icons-round {
    color: var(--info);
    flex-shrink: 0;
}

.qr-instructions p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Form Hint */
.form-hint {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.optional {
    font-weight: 400;
    color: var(--text-muted);
}

/* Input Wrapper */
.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.input-wrapper .form-input {
    padding-left: 42px;
}

/* ==================== TOAST NOTIFICATION ==================== */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    padding: 12px 20px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 99999;
    box-shadow: var(--shadow-lg);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 90vw;
}

.toast.visible {
    transform: translateX(-50%) translateY(0);
}

.toast-icon {
    color: var(--accent-primary);
    font-size: 18px;
}

/* ==================== LOADING OVERLAY ==================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 17, 23, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99998;
    backdrop-filter: blur(8px);
    transition: opacity 0.25s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    position: relative;
    width: 60px;
    height: 60px;
}

.spinner-ring {
    position: absolute;
    border: 2px solid transparent;
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-ring:nth-child(1) {
    width: 60px;
    height: 60px;
}

.spinner-ring:nth-child(2) {
    width: 44px;
    height: 44px;
    animation-duration: 1.5s;
    animation-direction: reverse;
    top: 8px;
    left: 8px;
}

.spinner-ring:nth-child(3) {
    width: 28px;
    height: 28px;
    animation-duration: 2s;
    top: 16px;
    left: 16px;
}

#loading-text {
    margin-top: 40px;
    color: #A0A8B8;
    font-size: 0.9375rem;
    font-weight: 500;
}

/* ==================== UTILITY CLASSES ==================== */
.hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}