/* ==================== LAYOUT SYSTEM ==================== */

/* Screen Management - Scrollable with sticky bottom */
.screen {
    display: none;
    opacity: 0;
    height: 100vh;
    height: 100dvh;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    transform: translateX(100%);
    transition: opacity 0.35s ease, transform 0.35s ease;
    overflow: hidden;
}

.screen.active {
    display: flex;
    opacity: 1;
    transform: translateX(0);
    position: relative;
    flex-direction: column;
}

.screen.exit {
    opacity: 0;
    transform: translateX(-100%);
}

.screen-scrollable {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 100px;
}

/* ==================== ONBOARDING SCREEN ==================== */
.onboarding-wrapper {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.onboarding-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 48px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* Brand Section */
.brand-section {
    text-align: center;
    margin-top: -20px;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.logo-image {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.logo-badge {
    background: var(--accent-secondary-light);
    color: var(--accent-secondary);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.brand-title {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 6px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-subtitle {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 320px;
    margin: 0 auto;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 480px;
    margin-top: 8px;
}

.feature-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    padding: 18px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    transition: all 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-color: var(--accent-primary);
}

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

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

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

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

/* How It Works */
.how-it-works {
    width: 100%;
    max-width: 480px;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 16px;
}

.steps-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.step-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.step-number {
    font-size: 1.375rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.5;
    min-width: 36px;
    text-align: center;
}

.step-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.step-icon {
    font-size: 24px;
    color: var(--accent-primary);
    flex-shrink: 0;
}

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

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

/* Sticky CTA Section */
.cta-section-sticky {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-primary);
    padding: 16px 20px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

.btn-sticky {
    width: 100%;
    max-width: 400px;
}

.trust-badges {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.badge-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

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

.badge-divider {
    color: var(--text-muted);
    font-size: 0.625rem;
}

/* ==================== LOGIN SCREEN ==================== */
.login-wrapper {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px 24px;
    position: relative;
}

/* Progress Indicator */
.progress-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
}

.progress-step.active {
    color: var(--accent-primary);
}

.progress-step.completed {
    color: var(--success);
}

.step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

.progress-step.active .step-dot {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    box-shadow: var(--shadow-glow);
}

.progress-step.completed .step-dot {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.progress-step span:last-child {
    font-size: 10px;
    font-weight: 600;
}

.progress-line {
    width: 40px;
    height: 2px;
    background: var(--border-primary);
}

.progress-line.completed {
    background: var(--success);
}

/* Login Card */
.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow-md);
}

.card-header {
    text-align: center;
    margin-bottom: 20px;
}

.header-icon {
    margin-bottom: 12px;
}

.header-logo {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
}

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

.card-header p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Form Styles */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.form-label-icon {
    font-size: 16px;
    color: var(--accent-primary);
}

.phone-input-group {
    display: flex;
    gap: 8px;
}

.country-selector {
    background: var(--bg-input);
    border: 2px solid var(--border-primary);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    white-space: nowrap;
    color: var(--text-primary);
    min-width: fit-content;
    flex-shrink: 0;
}

.flag {
    font-size: 1.5rem;
    line-height: 1;
    display: inline-block;
    min-width: 1.5rem;
    text-align: center;
    vertical-align: middle;
}

.country-code {
    font-weight: 700;
    font-size: 0.875rem;
    min-width: 36px;
    text-align: left;
}

.country-selector .material-icons-round {
    font-size: 18px;
    color: var(--text-muted);
}

.form-input {
    width: 100%;
    background: var(--bg-input);
    border: 2px solid var(--border-primary);
    padding: 12px 14px;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-light);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-error {
    font-size: 0.75rem;
    color: var(--danger);
    min-height: 16px;
}

/* Country Dropdown */
.country-dropdown {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-secondary);
    border-radius: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
}

.dropdown-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border-bottom: 1px solid var(--border-primary);
}

.dropdown-search .material-icons-round {
    color: var(--text-muted);
    font-size: 20px;
}

.dropdown-search input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: inherit;
}

.dropdown-search input::placeholder {
    color: var(--text-muted);
}

.dropdown-search input:focus {
    outline: none;
}

.country-list {
    overflow-y: auto;
    flex: 1;
    padding: 6px;
}

.country-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
}

.country-item:hover {
    background: var(--bg-tertiary);
}

.country-item .flag {
    font-size: 1.5rem;
}

.country-name {
    flex: 1;
    font-weight: 600;
    font-size: 0.875rem;
}

.country-dial-code {
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

/* Security Notice */
.security-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: var(--accent-secondary-light);
    border: 1px solid var(--accent-secondary);
    border-radius: 12px;
    margin-top: 16px;
}

.security-notice .material-icons-round {
    font-size: 22px;
    color: var(--accent-secondary);
    flex-shrink: 0;
}

.security-notice strong {
    display: block;
    font-size: 0.8125rem;
    margin-bottom: 2px;
    color: var(--accent-secondary);
}

.security-notice p {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

/* ==================== HISTORY TYPE SCREEN ==================== */
.history-type-wrapper {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 48px 20px 24px;
    overflow-y: auto;
    overflow-x: hidden;
}

.screen-header {
    text-align: center;
    margin-bottom: 20px;
}

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

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

/* Report Grid */
.report-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 420px;
    margin: 0 auto 16px;
    pointer-events: auto;
}

.report-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-primary);
    border-radius: 16px;
    padding: 18px 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    z-index: 1;
}

.report-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--card-accent);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    border-radius: 14px;
}

.report-card:active::after {
    opacity: 0.1;
}

.report-card:active {
    transform: scale(0.97);
}

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

.report-card-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.report-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--icon-bg);
}

.report-icon .material-icons-round {
    font-size: 24px;
    color: var(--icon-color);
}

.report-card h3 {
    font-size: 0.9375rem;
    font-weight: 700;
}

.report-card p {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.report-features {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.feature-tag {
    font-size: 0.625rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 100px;
    background: var(--tag-bg);
    color: var(--tag-color);
}

.report-card-pulse {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 8px;
    height: 8px;
    background: var(--card-accent);
    border-radius: 50%;
    animation: pulse-ring 2s ease-in-out infinite;
}

@keyframes pulse-ring {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.5);
    }
}

/* Report Card Variants */
.report-card[data-type="call"] {
    --card-accent: var(--color-call);
    --icon-bg: var(--color-call-light);
    --icon-color: var(--color-call);
    --tag-bg: var(--color-call-light);
    --tag-color: var(--color-call);
}

.report-card[data-type="whatsapp"] {
    --card-accent: var(--color-whatsapp);
    --icon-bg: var(--color-whatsapp-light);
    --icon-color: var(--color-whatsapp);
    --tag-bg: var(--color-whatsapp-light);
    --tag-color: var(--color-whatsapp);
}

.report-card[data-type="sms"] {
    --card-accent: var(--color-sms);
    --icon-bg: var(--color-sms-light);
    --icon-color: var(--color-sms);
    --tag-bg: var(--color-sms-light);
    --tag-color: var(--color-sms);
}

.report-card[data-type="all"] {
    --card-accent: var(--color-all);
    --icon-bg: var(--color-all-light);
    --icon-color: var(--color-all);
    --tag-bg: var(--color-all-light);
    --tag-color: var(--color-all);
}

/* Featured Card */
.report-card.featured {
    grid-column: 1 / -1;
    border-color: var(--color-all);
    background: var(--color-all-light);
}

.featured-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--color-all);
    color: white;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.625rem;
    font-weight: 700;
    width: fit-content;
}

.featured-badge .material-icons-round {
    font-size: 14px;
}

/* Info Card */
.info-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 14px;
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
}

.info-card .material-icons-round {
    font-size: 24px;
    color: var(--accent-secondary);
    flex-shrink: 0;
}

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

.info-card p {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}