/* ============================================
   TELA DE LOGIN/CADASTRO (página standalone)
   ============================================ */

.app-splash {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    background-image: url('/images/splashscreen.png');
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    color: #fff;
}

#mobile-music-toggle {
    display: none;
}

body.app-ready #mobile-music-toggle:not([hidden]) {
    position: fixed;
    top: max(14px, env(safe-area-inset-top));
    left: max(14px, env(safe-area-inset-left));
    z-index: 5100;
    display: grid;
    width: 48px;
    height: 48px;
    padding: 0;
    place-items: center;
    border: 2px solid rgba(73, 20, 39, 0.72);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.app-splash-content {
    position: absolute;
    right: 50%;
    bottom: clamp(105px, 19vh, 200px);
    transform: translateX(50%);
    width: min(78vw, 420px);
    text-align: center;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.app-splash-progress {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    border: 2px solid rgba(73, 20, 39, 0.82);
    background: rgba(73, 20, 39, 0.2);
    box-shadow: 0 3px 14px rgba(73, 20, 39, 0.3);
}

#app-splash-progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: #8f1641;
    transition: width 0.18s ease-out;
}

.app-splash-copyright {
    margin: 14px 0 0;
    color: #491427;
    font-size: clamp(0.68rem, 2.2vw, 0.82rem);
    font-weight: 600;
    line-height: 1.35;
    text-align: center;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.95);
}

@media (orientation: portrait) {
    .app-splash {
        background-image: url('/images/splashscreen_mobile.png');
    }

    .app-splash-content {
        bottom: clamp(210px, 31vh, 320px);
        width: min(76vw, 360px);
    }
}

/* Fundo animado do auth */
.login-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(5, 5, 8, 0.94), rgba(18, 8, 18, 0.94));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: fadeIn 0.4s ease-out;
}

.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 25% 25%, rgba(201, 168, 76, 0.18) 0%, transparent 42%),
        radial-gradient(circle at 75% 65%, rgba(128, 0, 32, 0.28) 0%, transparent 45%),
        radial-gradient(circle at 50% 80%, rgba(80, 60, 10, 0.18) 0%, transparent 40%);
    pointer-events: none;
}

.login-page::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0px, rgba(255, 255, 255, 0.018) 1px, transparent 1px, transparent 80px),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.018) 0px, rgba(255, 255, 255, 0.018) 1px, transparent 1px, transparent 80px);
    pointer-events: none;
}

.login-box {
    position: relative;
    background: rgba(18, 18, 24, 0.88);
    border: 1px solid rgba(201, 168, 76, 0.45);
    padding: 44px 36px;
    border-radius: 20px;
    width: 92%;
    max-width: 400px;
    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.75),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 0 40px rgba(201, 168, 76, 0.08);
    animation: slideUp 0.5s ease-out;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.6), transparent);
    border-radius: 2px;
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-header h1 {
    color: var(--text-light);
    font-size: 2em;
    font-weight: 500;
    margin-bottom: 8px;
    letter-spacing: 1px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.login-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95em;
    letter-spacing: 0.6px;
}

.login-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 22px;
}

.login-tab {
    flex: 1;
    padding: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.login-tab.active {
    background: rgba(128, 0, 32, 0.65);
    border-color: var(--gold);
    color: var(--text-light);
    box-shadow: 0 0 18px rgba(201, 168, 76, 0.12);
}

.login-tab:hover {
    background: rgba(128, 0, 32, 0.4);
    border-color: var(--gold);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-form input {
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(201, 168, 76, 0.25);
    border-radius: 10px;
    color: var(--text-light);
    font-family: var(--font-family);
    font-size: 15px;
    outline: none;
    transition: all 0.2s ease;
}

.login-form input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.18);
}

.login-form input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.login-button {
    padding: 14px 24px;
    background: linear-gradient(180deg, rgba(128, 0, 32, 0.85), rgba(100, 0, 28, 0.95));
    color: var(--text-light);
    border: 1px solid rgba(201, 168, 76, 0.45);
    border-radius: 10px;
    font-family: var(--font-family);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

.login-button:hover {
    background: linear-gradient(180deg, rgba(128, 0, 32, 1), rgba(110, 0, 32, 1));
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
}

.login-button:active {
    transform: translateY(0);
}

.login-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.login-divider {
    display: flex;
    align-items: center;
    margin: 22px 0;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.12);
    margin: 0 16px;
}

.google-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    font-family: var(--font-family);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}

.google-button {
    position: relative;
    overflow: hidden;
}

.google-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
    transition: left 0.5s ease;
}

.google-button:hover::after {
    left: 100%;
}

.google-button:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.google-button:active {
    transform: translateY(0);
}

.google-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.google-icon {
    width: 20px;
    height: 20px;
}

.login-footer {
    margin-top: 22px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    line-height: 1.5;
}

.login-error {
    background: rgba(244, 67, 54, 0.22);
    border: 1px solid rgba(244, 67, 54, 0.45);
    color: #ff6b6b;
    padding: 12px;
    border-radius: 10px;
    font-size: 14px;
    text-align: center;
    display: none;
    margin-bottom: 16px;
}

.login-error.visible {
    display: block;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.login-success {
    background: rgba(76, 175, 80, 0.22);
    border: 1px solid rgba(76, 175, 80, 0.45);
    color: #81c784;
    padding: 12px;
    border-radius: 10px;
    font-size: 14px;
    text-align: center;
    display: none;
    margin-bottom: 16px;
}

.login-success.visible {
    display: block;
}

.login-loading {
    display: none;
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
    padding: 10px;
}

.login-loading.visible {
    display: block;
}

.login-loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* ============================================
   TELA DE PAYWALL (Compra)
   ============================================ */

.paywall-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    z-index: 2000;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    background:
        linear-gradient(135deg, rgba(5, 5, 8, 0.94), rgba(18, 8, 18, 0.94));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: fadeIn 0.4s ease-out;
    padding: 20px;
}

.paywall-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 25% 25%, rgba(201, 168, 76, 0.18) 0%, transparent 42%),
        radial-gradient(circle at 75% 75%, rgba(76, 200, 168, 0.12) 0%, transparent 42%);
    pointer-events: none;
    z-index: -1;
}

.paywall-box {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px 30px;
    max-width: 500px;
    width: 100%;
    flex: 0 0 auto;
    box-sizing: border-box;
    margin-block: auto;
    box-shadow:
        0 8px 32px 0 rgba(31, 38, 135, 0.37),
        inset 0 0 20px rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.paywall-header {
    text-align: center;
    margin-bottom: 30px;
}

.paywall-header h1 {
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}

.paywall-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin: 0;
}

.paywall-content {
    margin-bottom: 30px;
}

.premium-benefits {
    background: rgba(201, 168, 76, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.premium-benefits h2 {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 16px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.premium-benefits ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.premium-benefits li {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    line-height: 1.6;
    padding-left: 0;
}

.paywall-pricing {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.price-card {
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.2), rgba(76, 200, 168, 0.1));
    border: 2px solid rgba(201, 168, 76, 0.3);
    border-radius: 12px;
    padding: 20px 30px;
    text-align: center;
}

.paywall-pricing {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.price-card.plan-option {
    padding: 16px 12px;
    cursor: pointer;
    font-family: inherit;
}

.price-card.plan-option[hidden] {
    display: none;
}

.price-card.plan-option.selected {
    border: 3px solid #8f1641;
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(73, 20, 39, 0.24);
}

.price-card.plan-option .price-description {
    min-height: 2.6em;
}

.paywall-demo-button {
    margin-top: 10px;
    padding: 10px 14px;
    border: 0;
    background: transparent;
    color: #491427;
    text-decoration: underline;
    cursor: pointer;
}

@media (max-width: 520px) {
    .paywall-pricing { grid-template-columns: 1fr; }
}

.price-amount {
    color: #c9a84c;
    font-size: 36px;
    font-weight: 700;
    margin: 0;
    line-height: 1;
}

.price-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.upgrade-price-note {
    width: min(100%, 520px);
    margin: 12px auto 0;
    padding: 10px 14px;
    border: 1px solid rgba(201, 168, 76, 0.35);
    border-radius: 8px;
    background: rgba(201, 168, 76, 0.09);
    color: #111111;
    font-size: 0.84rem;
    text-align: center;
}

.paywall-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.btn-primary-large {
    background: linear-gradient(135deg, #c9a84c, #9b8035);
    color: #000;
    border: none;
    border-radius: 8px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(201, 168, 76, 0.3);
}

.btn-primary-large:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(201, 168, 76, 0.4);
}

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

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.paywall-error {
    background: rgba(220, 53, 69, 0.15);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #ff6b6b;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
    margin-bottom: 16px;
    display: none;
}

.paywall-error.visible,
.paywall-error[style*="display: block"] {
    display: block;
}

.paywall-loading {
    display: none;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    padding: 10px;
    margin-bottom: 16px;
}

.paywall-loading.visible,
.paywall-loading[style*="display: block"] {
    display: block;
}

.paywall-loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

.paywall-footer {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    text-align: center;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive */
@media (max-width: 480px) and (orientation: portrait) {
    .paywall-box {
        padding: 30px 20px;
    }

    .paywall-header h1 {
        font-size: 20px;
    }

    .price-amount {
        font-size: 28px;
    }

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

/* ================================================================
   IDENTIDADE VISUAL — FICHA DE ESTUDOS MEDQUEST
   ================================================================ */
.login-page,
.paywall-page {
    background-color: #ede5d4;
    background-image: url('/images/menu_background.jpg');
    background-position: center;
    background-size: cover;
}

.login-page::before,
.paywall-page::before {
    z-index: 0;
    background:
        linear-gradient(115deg, rgba(34, 13, 21, 0.42), rgba(73, 20, 39, 0.14)),
        radial-gradient(circle at 78% 18%, rgba(201, 168, 76, 0.22), transparent 34%);
}

.paywall-page::before {
    content: none;
}

.login-page::after {
    background: repeating-linear-gradient(
        0deg,
        transparent 0,
        transparent 31px,
        rgba(51, 105, 180, 0.06) 31px,
        rgba(51, 105, 180, 0.06) 32px
    );
}

.login-box,
.paywall-box {
    isolation: isolate;
    overflow: hidden;
    border: 1px solid rgba(102, 76, 49, 0.34);
    border-radius: 18px 22px 20px 16px;
    background-color: rgba(255, 252, 241, 0.96);
    background-image: repeating-linear-gradient(
        0deg,
        transparent 0,
        transparent 31px,
        rgba(53, 111, 190, 0.1) 31px,
        rgba(53, 111, 190, 0.1) 32px
    );
    box-shadow:
        0 24px 60px rgba(34, 13, 21, 0.38),
        inset 0 0 40px rgba(137, 105, 55, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.login-box {
    max-width: 430px;
    padding: 42px 42px 34px 58px;
    transform: rotate(-0.35deg);
}

.paywall-box {
    max-width: 620px;
    padding: 36px 46px 30px 62px;
}

.login-box::after,
.paywall-box::after {
    content: '';
    position: absolute;
    z-index: -1;
    top: 0;
    bottom: 0;
    left: 30px;
    width: 2px;
    background: rgba(183, 62, 78, 0.3);
}

.login-box::before {
    background: linear-gradient(90deg, transparent, #8f1641, transparent);
}

.auth-kicker {
    display: inline-block;
    margin-bottom: 10px;
    color: #2457a6;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.auth-emblem {
    display: block;
    margin: 0 auto 2px;
    color: #c0912d;
    font-size: 22px;
}

.login-header h1,
.paywall-header h1 {
    color: #491427;
    font-family: var(--font-family);
    font-weight: 700;
    text-shadow: none;
}

.login-header h1 {
    font-size: clamp(2.2rem, 5vw, 3rem);
    letter-spacing: -0.03em;
}

.login-header p,
.paywall-header p {
    color: #315e91;
    font-weight: 600;
}

.google-button {
    min-height: 54px;
    border: 1px solid rgba(73, 20, 39, 0.25);
    border-bottom: 3px solid rgba(73, 20, 39, 0.42);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.88);
    color: #2b2023;
    box-shadow: 0 5px 14px rgba(73, 20, 39, 0.12);
}

.google-button:hover {
    border-color: #8f1641;
    background: #fff;
    box-shadow: 0 8px 20px rgba(73, 20, 39, 0.18);
}

.login-footer {
    color: rgba(53, 43, 38, 0.7);
}

.premium-benefits {
    position: relative;
    border: 1px solid rgba(36, 87, 166, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.58);
    box-shadow: inset 4px 0 0 rgba(143, 22, 65, 0.68);
}

.premium-benefits h2 {
    color: #491427;
    font-size: 15px;
}

.premium-benefits li {
    color: #34302d;
    font-size: 14px;
}

.premium-benefits li::first-letter {
    color: #2457a6;
}

.price-card {
    width: min(100%, 350px);
    border: 1px solid rgba(143, 22, 65, 0.32);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255, 250, 225, 0.96), rgba(237, 219, 165, 0.76));
    box-shadow: 0 8px 22px rgba(73, 20, 39, 0.13);
}

.price-amount {
    color: #8f1641;
}

.price-description {
    color: #5d4b40;
    font-weight: 700;
}

.btn-primary-large,
.mp-btn-pay {
    min-height: 52px;
    border: 1px solid #6c102f !important;
    border-bottom: 4px solid #4d0c24 !important;
    border-radius: 14px !important;
    background: linear-gradient(180deg, #a61d4d, #7b1238) !important;
    color: #fffaf0 !important;
    box-shadow: 0 7px 18px rgba(73, 20, 39, 0.25) !important;
}

.btn-primary-large:hover:not(:disabled),
.mp-btn-pay:hover:not(:disabled) {
    background: linear-gradient(180deg, #b62558, #891541) !important;
}

#checkout-container {
    border: 1px solid rgba(73, 20, 39, 0.18) !important;
    background: rgba(255, 255, 255, 0.56) !important;
}

.payment-methods-tabs {
    border-bottom-color: rgba(73, 20, 39, 0.16) !important;
}

.payment-methods-tabs button {
    color: #665a52 !important;
}

.payment-methods-tabs button.active {
    background: rgba(143, 22, 65, 0.12) !important;
    color: #8f1641 !important;
}

.mp-card-form .mp-input {
    border-color: rgba(73, 20, 39, 0.22) !important;
    background: rgba(255, 255, 255, 0.86) !important;
    color: #2f2926 !important;
}

.mp-card-form .mp-input::placeholder {
    color: rgba(47, 41, 38, 0.5) !important;
}

.paywall-footer {
    color: rgba(73, 20, 39, 0.68);
    font-weight: 700;
}

@media (orientation: portrait) {
    .login-page,
    .paywall-page {
        background-image: url('/images/menu_background_mobile.png');
    }

    .login-box,
    .paywall-box {
        width: min(92vw, 560px);
        padding-left: 44px;
        padding-right: 24px;
    }

    .login-box::after,
    .paywall-box::after {
        left: 24px;
    }

    .paywall-page {
        align-items: flex-start;
        padding: max(18px, env(safe-area-inset-top)) 12px max(18px, env(safe-area-inset-bottom));
    }
}
