:root {
    --bg: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --surface: #ffffff;
    --border-color: #e5e7eb;
    --text: #111827;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;
    --accent: #f99839;
    --accent-soft: #faae87;
    --success: #00c853;
    --danger: #ff5c70;
    --shadow: 0 18px 60px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    background: #ffffff;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #ffffff;
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
    font: inherit;
}

button,
a,
label {
    -webkit-tap-highlight-color: transparent;
}

button {
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, opacity 0.16s ease;
}

button:active {
    transform: translateY(1px);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.app-container {
    width: min(100%, 520px);
    min-height: 100vh;
    margin: 0 auto;
    background: var(--bg);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.header,
.profile-name-bar,
.bottom-nav {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px);
}

.header {
    position: sticky;
    top: 0;
    z-index: 30;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--border-color);
}

.privacy-logo {
    width: 108px;
    height: 28px;
    display: block;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-btn,
.more-btn,
.login-close-btn,
.mimo-close-btn,
.toggle-password {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.icon-btn:hover,
.more-btn:hover,
.login-close-btn:hover,
.mimo-close-btn:hover,
.toggle-password:hover {
    background: rgba(15, 23, 42, 0.06);
}

.login-header-btn,
.login-submit-btn,
.subscribe-cta-btn,
.social-login-btn {
    border: 0;
    cursor: pointer;
    font-weight: 800;
}

.login-header-btn {
    min-height: 38px;
    padding: 0 18px;
    border-radius: 999px;
    background: var(--accent);
    color: #111827;
}

.profile-name-bar {
    position: sticky;
    top: 58px;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
}

.profile-name-text {
    font-size: 15px;
    font-weight: 800;
}

.cover-section {
    position: relative;
}

.cover-image {
    height: 192px;
    background: linear-gradient(135deg, #37313d, #7b3249 50%, #f99839);
    overflow: hidden;
}

.cover-image img,
.profile-pic-container img,
.creator-avatar img,
.card-avatar,
.post-avatar img,
.post-media img,
.post-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.profile-pic-wrapper {
    position: absolute;
    left: 18px;
    top: 144px;
}

.profile-pic-container {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    overflow: hidden;
    border: 5px solid var(--bg);
    background: linear-gradient(135deg, #292932, #f99839);
}

.stats-row {
    min-height: 62px;
    padding: 12px 18px 12px 132px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    background: var(--bg);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
}

.profile-info {
    padding: 16px 18px 18px;
}

.name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.display-name {
    margin: 0;
    font-size: 25px;
    line-height: 1.15;
    letter-spacing: 0;
}

.username {
    margin: 4px 0 12px;
    color: var(--text-muted);
    font-size: 14px;
}

.bio {
    margin: 0 0 16px;
    color: var(--text-secondary);
    line-height: 1.45;
    font-size: 14px;
}

.subscribe-cta-btn {
    width: 100%;
    min-height: 50px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), var(--accent-soft));
    color: #151007;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 15px;
}

.subs-container,
.action-buttons,
.feed-tabs,
.posts-feed,
.page-search {
    border-top: 1px solid var(--border-color);
}

.subs-container {
    padding: 16px 18px;
    display: grid;
    gap: 18px;
}

.subs-title {
    margin: 0 0 10px;
    font-size: 15px;
}

.subs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.subs-btn {
    width: 100%;
    min-height: 48px;
    margin-top: 8px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    cursor: pointer;
}

.subs-btn:hover,
.action-btn:hover,
.feed-tab:hover {
    border-color: rgba(249, 152, 57, 0.65);
    background: #fff7ed;
}

.subs-duration {
    color: var(--text-secondary);
    font-size: 14px;
}

.subs-price {
    color: var(--accent);
    font-weight: 800;
}

.action-buttons {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 14px 18px;
}

.action-btn {
    min-height: 44px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 800;
}

.mimo-picker {
    position: absolute;
    z-index: 20;
    left: 18px;
    right: 18px;
    top: 66px;
}

.mimo-picker-content {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 16px;
}

.mimo-picker-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.mimo-pick-btn {
    min-height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text);
    cursor: pointer;
    font-weight: 800;
}

.mimo-pick-btn.is-selected {
    border-color: var(--success);
    background: rgba(0, 200, 83, 0.16);
}

.feed-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.feed-tab {
    min-height: 52px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 800;
}

.feed-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-count {
    color: inherit;
}

.creator-avatar,
.post-avatar {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #2c2c32, #f99839);
}

.posts-feed {
    background: var(--bg);
}

.post-card {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-color);
}

.post-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.post-author {
    font-weight: 800;
    font-size: 14px;
}

.post-time {
    color: var(--text-muted);
    font-size: 12px;
}

.post-text {
    margin: 0 0 12px;
    color: var(--text);
    line-height: 1.45;
    font-size: 14px;
}

.post-media {
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-tertiary);
    max-height: 620px;
}

.post-actions {
    margin-top: 12px;
    display: flex;
    gap: 14px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
}

.post-comments {
    margin-top: 14px;
    display: grid;
    gap: 10px;
}

.comment-item {
    display: grid;
    grid-template-columns: 30px 1fr;
    gap: 9px;
    align-items: start;
}

.comment-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #3a3442, #f99839);
    color: var(--text);
    font-size: 11px;
    font-weight: 800;
}

.comment-body {
    min-width: 0;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.comment-name {
    display: block;
    margin-bottom: 3px;
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
}

.comment-text {
    margin: 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.35;
}

.content-spacer {
    height: 76px;
}

.page-search {
    padding: 14px 18px 90px;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    min-height: 44px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-tertiary);
}

.search-input-wrapper input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    color: var(--text);
    background: transparent;
}

.search-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 14px;
}

.search-card {
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border-color);
}

.card-cover {
    height: 92px;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-tertiary);
}

.card-info {
    display: flex;
    gap: 8px;
    padding: 10px;
}

.card-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #33333b, #f99839);
}

.card-details {
    min-width: 0;
}

.card-name-row {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.card-name,
.card-username {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-name {
    font-size: 12px;
    font-weight: 800;
}

.card-username {
    color: var(--text-muted);
    font-size: 11px;
}

.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: 35;
    width: min(100%, 520px);
    transform: translateX(-50%);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    padding: 8px 12px max(8px, env(safe-area-inset-bottom));
}

.nav-item {
    min-width: 84px;
    min-height: 50px;
    color: var(--text-muted);
    text-decoration: none;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 800;
}

.nav-item.active {
    color: var(--accent);
}

.login-overlay,
.mimo-overlay,
.chat-overlay,
.age-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: none;
    place-items: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.32);
    backdrop-filter: blur(6px);
}

.login-overlay.is-open,
.mimo-overlay.is-open,
.chat-overlay.is-open,
.age-overlay.is-open {
    display: grid;
}

.login-modal,
.mimo-modal,
.chat-modal,
.age-modal {
    width: min(100%, 430px);
    max-height: calc(100vh - 36px);
    overflow: auto;
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.login-close-btn,
.mimo-close-btn,
.chat-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
}

.chat-modal {
    padding: 0;
    display: flex;
    flex-direction: column;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 54px 16px 18px;
    border-bottom: 1px solid var(--border-color);
}

.chat-header img {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-header h3 {
    margin: 0 0 3px;
    font-size: 16px;
}

.chat-header span {
    color: var(--success);
    font-size: 12px;
    font-weight: 700;
}

.chat-messages {
    min-height: 310px;
    max-height: min(52vh, 430px);
    overflow: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--bg-secondary);
}

.chat-message {
    width: fit-content;
    max-width: 84%;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
}

.chat-message.bot {
    align-self: flex-start;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border-color);
}

.chat-message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--accent), var(--accent-soft));
    color: #14100b;
    font-weight: 700;
}

.chat-form {
    display: flex;
    gap: 10px;
    padding: 14px;
    border-top: 1px solid var(--border-color);
}

.chat-form input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-tertiary);
    color: var(--text);
    padding: 0 14px;
    min-height: 42px;
    outline: 0;
}

.chat-form button {
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: #111;
    font-weight: 800;
    padding: 0 16px;
    cursor: pointer;
}

.age-modal {
    text-align: center;
}

.age-modal h2 {
    margin: 0 0 10px;
    font-size: 26px;
}

.age-modal p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.45;
}

.age-actions {
    display: grid;
    gap: 10px;
    margin-top: 22px;
}

.age-confirm-btn,
.age-exit-btn {
    min-height: 46px;
    border-radius: 999px;
    font-weight: 800;
    cursor: pointer;
}

.age-confirm-btn {
    border: 0;
    background: linear-gradient(135deg, var(--accent), var(--accent-soft));
    color: #111;
}

.age-exit-btn {
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
}

.payer-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.payer-form label {
    display: grid;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 800;
}

.payer-form label:first-child,
.payer-form label:nth-child(3) {
    grid-column: 1 / -1;
}

.payer-form input {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text);
    padding: 0 12px;
    outline: 0;
}


.login-logo {
    display: flex;
    justify-content: center;
    margin: 8px 0 18px;
}

.login-title,
.login-subtitle {
    text-align: center;
}

.login-title {
    margin: 0;
    font-size: 24px;
}

.login-subtitle {
    margin: 8px 0 22px;
    color: var(--text-secondary);
    font-size: 14px;
}

.login-form,
.social-login-buttons {
    display: grid;
    gap: 14px;
}

.input-group label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
}

.input-wrapper {
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-tertiary);
}

.input-wrapper input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
}

.forgot-password,
.signup-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
}

.login-submit-btn,
.social-login-btn {
    min-height: 48px;
    border-radius: 999px;
}

.login-submit-btn {
    background: var(--accent);
    color: #111;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 12px;
    margin: 22px 0;
}

.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--border-color);
}

.social-login-btn {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-footer {
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    margin: 18px 0 0;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 88px;
    z-index: 80;
    width: min(calc(100% - 32px), 420px);
    transform: translateX(-50%);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    padding: 12px 14px;
    box-shadow: var(--shadow);
    font-size: 13px;
}

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

@media (max-width: 390px) {
    .stats-row {
        gap: 10px;
        padding-left: 118px;
    }

    .profile-pic-container {
        width: 84px;
        height: 84px;
    }

    .search-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Media Queries Responsivas (Tablet & Desktop) --- */
@media (min-width: 768px) {
    .app-container {
        width: 100%;
        margin: 0;
        border-left: none;
        border-right: none;
    }

    .bottom-nav {
        width: 100%;
    }

    /* Otimizar proporções da Capa e Avatar */
    .cover-image {
        height: 350px;
    }
    
    .profile-pic-wrapper {
        top: 250px;
        left: 40px;
    }

    .profile-pic-container {
        width: 150px;
        height: 150px;
        border-width: 8px;
    }

    /* Ajustar margem da linha de estatísticas para não ficar atrás da foto */
    .stats-row {
        padding-left: 210px;
        min-height: 80px;
    }

    /* Ajustar vídeos e imagens no PC para não esticarem ou cortarem */
    .post-media {
        max-height: 80vh;
        background: var(--bg-secondary);
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .post-media img,
    .post-media video {
        width: auto;
        height: auto;
        max-width: 100%;
        max-height: 80vh;
        object-fit: contain;
    }

    /* Grade de Pesquisa mais espaçosa */
    .search-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

/* --- Telegram Pop-up Overlay --- */
.telegram-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    place-items: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.32);
    backdrop-filter: blur(4px);
}

.telegram-overlay.is-open {
    display: grid;
}

.telegram-modal {
    width: min(100%, 400px);
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px 24px;
    position: relative;
    text-align: center;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
    animation: popupFade 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popupFade {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.telegram-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
}
.telegram-close-btn:hover {
    background: rgba(15, 23, 42, 0.06);
    color: var(--text);
}

.telegram-icon-container {
    width: 72px;
    height: 72px;
    background: rgba(34, 158, 217, 0.1);
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin: 0 auto 20px;
}

.telegram-title {
    font-size: 20px;
    font-weight: 800;
    margin: 0 0 12px;
    line-height: 1.3;
}

.telegram-desc {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 24px;
}

.telegram-cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    background: #229ED9;
    color: #ffffff;
    font-weight: 800;
    font-size: 15px;
    text-decoration: none;
    border-radius: 999px;
    transition: background 0.2s, transform 0.16s;
}

.telegram-cta-btn:active {
    transform: translateY(1px);
}
.telegram-cta-btn:hover {
    background: #1c8ac0;
}
