/* Home do portal: estilos exclusivos da entrada principal. */
.portal-home-main {
    display: flex;
    align-items: flex-start;
    min-height: 100svh;
}

.portal-home-shell {
    max-width: 82rem;
    padding-top: clamp(2rem, 10vh, 7rem);
}

.portal-home-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(111, 137, 167, 0.22);
    border-radius: 1.75rem;
    background: linear-gradient(120deg, rgba(18, 29, 49, 0.97), rgba(9, 24, 38, 0.95) 60%, rgba(7, 18, 32, 0.98));
    box-shadow: 0 2rem 5rem rgba(2, 8, 23, 0.28), inset 0 1px rgba(255, 255, 255, 0.035);
}

.portal-home-card::after {
    position: absolute;
    content: '';
    pointer-events: none;
    inset: 0;
    background: radial-gradient(circle at 60% 0%, rgba(18, 184, 166, 0.14), transparent 32%), linear-gradient(125deg, transparent 50%, rgba(28, 74, 91, 0.12));
}

.portal-home-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 0.65fr);
    gap: clamp(2rem, 6vw, 6rem);
    padding: clamp(2rem, 5vw, 5.25rem);
}

.portal-home-copy {
    align-self: center;
    max-width: 45rem;
}

.portal-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0;
    padding: 0.6rem 0.85rem;
    border: 1px solid rgba(45, 212, 191, 0.24);
    border-radius: 999px;
    background: rgba(13, 148, 136, 0.1);
    color: #53ded0;
    font-size: 0.69rem;
    font-weight: var(--ui-weight-bold);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.portal-eyebrow i { font-size: 0.85rem; }

.portal-home-card h1 {
    max-width: 48rem;
    margin: 2rem 0 0;
    color: #f5f8fc;
    font-size: clamp(2.4rem, 4.2vw, 4rem);
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 1.04;
}

.portal-home-description {
    max-width: 43rem;
    margin: 1.5rem 0 0;
    color: #aebdce;
    font-size: clamp(1rem, 1.4vw, 1.16rem);
    line-height: 1.75;
}

.portal-home-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.8rem;
    margin-top: 2.4rem;
}

.portal-primary-action,
.portal-secondary-action {
    display: inline-flex;
    min-height: 3.5rem;
    align-items: center;
    gap: 0.7rem;
    border-radius: 0.9rem;
    padding: 0.85rem 1.15rem;
    font-size: 0.9rem;
    font-weight: var(--ui-weight-bold);
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease;
}

.portal-primary-action {
    border: 1px solid rgba(94, 234, 212, 0.35);
    background: linear-gradient(135deg, #0f9f91, #0b7e7b);
    color: #f4fffd;
    box-shadow: 0 0.8rem 1.8rem rgba(7, 126, 123, 0.22);
}

.portal-primary-action i:last-child { margin-left: 0.25rem; font-size: 0.8rem; }

.portal-secondary-action {
    border: 1px solid rgba(145, 165, 190, 0.28);
    background: rgba(255, 255, 255, 0.025);
    color: #d7e0eb;
}

.portal-primary-action:hover,
.portal-secondary-action:hover { transform: translateY(-2px); }

.portal-primary-action:hover { box-shadow: 0 1rem 2rem rgba(7, 126, 123, 0.34); }
.portal-secondary-action:hover { border-color: rgba(83, 222, 208, 0.42); background: rgba(83, 222, 208, 0.07); color: #f5fffd; }
.portal-primary-action:focus-visible,
.portal-secondary-action:focus-visible { outline: 3px solid rgba(83, 222, 208, 0.45); outline-offset: 3px; }

.portal-access-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-left: 1px solid rgba(133, 159, 184, 0.2);
    padding-left: clamp(1.5rem, 4vw, 3.75rem);
}

.portal-robot-frame {
    position: relative;
    display: grid;
    width: min(100%, 14rem);
    aspect-ratio: 1;
    place-items: center;
    border: 1px solid rgba(83, 222, 208, 0.14);
    border-radius: 1.5rem;
    background: linear-gradient(145deg, rgba(40, 189, 176, 0.12), rgba(16, 44, 62, 0.16));
}

.portal-robot-frame img { width: 72%; height: 72%; object-fit: contain; filter: drop-shadow(0 1.2rem 1.2rem rgba(0, 0, 0, 0.2)); }

/* Saudação breve: termina em repouso e não mantém uma animação contínua. */
@keyframes portal-robot-greeting {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-6px) rotate(-2deg); }
    50% { transform: translateY(-2px) rotate(1.5deg); }
    75% { transform: translateY(-5px) rotate(-1deg); }
}

@media (prefers-reduced-motion: no-preference) {
    .portal-robot-frame img {
        animation: portal-robot-greeting 3.6s ease-in-out 1;
        transition: transform 280ms ease;
    }
}

@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
    .portal-robot-frame:hover img {
        transform: translateY(-4px) rotate(-2deg);
    }
}

.portal-robot-status { position: absolute; top: 1.1rem; right: 1.1rem; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: #53ded0; box-shadow: 0 0 0 0.3rem rgba(83, 222, 208, 0.12); }

.portal-access-copy { max-width: 17rem; margin-top: 1.6rem; }
.portal-access-title { margin: 0; color: #53ded0; font-size: 1.2rem; font-weight: 700; }
.portal-access-copy p:last-child { margin: 0.55rem 0 0; color: #aebdce; font-size: 0.94rem; line-height: 1.65; }
.portal-logged-out-state { position: relative; z-index: 1; max-width: 46rem; padding: clamp(2.5rem, 7vw, 6rem); }

.portal-home-main-guest {
    align-items: center;
    container-type: inline-size;
}

.portal-home-main-guest > #page-content {
    width: 100%;
    min-width: 0;
}

.portal-main.portal-home-main-guest #page-content > section.portal-home-shell {
    width: 100%;
    max-width: 68rem;
    margin-inline: auto;
    padding-block: clamp(1rem, 4vh, 3rem);
}

.portal-home-main-guest .portal-logged-out-state {
    max-width: none;
    padding: clamp(1.5rem, 6vw, 5rem);
    padding: clamp(1.5rem, 6cqi, 5rem);
}

.portal-home-main-guest .portal-home-card h1 {
    max-width: 18ch;
    margin-top: clamp(1.25rem, 3cqi, 2rem);
    font-size: clamp(2rem, 4.5vw, 4rem);
    font-size: clamp(2rem, 5.5cqi, 4rem);
    text-wrap: balance;
}

html[data-theme="light"] .portal-home-card {
    border-color: rgba(105, 133, 164, 0.2);
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 254, 0.98));
    box-shadow: 0 2rem 5rem rgba(55, 78, 108, 0.12), inset 0 1px rgba(255, 255, 255, 0.9);
}

html[data-theme="light"] .portal-home-card::after { background: radial-gradient(circle at 60% 0%, rgba(15, 159, 145, 0.08), transparent 34%); }
html[data-theme="light"] .portal-home-card h1 { color: #15243d; }
html[data-theme="light"] .portal-home-description,
html[data-theme="light"] .portal-access-copy p:last-child { color: #5d6c84; }
html[data-theme="light"] .portal-access-panel { border-left-color: rgba(105, 133, 164, 0.22); }
html[data-theme="light"] .portal-robot-frame { border-color: rgba(15, 159, 145, 0.15); background: linear-gradient(145deg, rgba(15, 159, 145, 0.08), rgba(223, 241, 245, 0.6)); }
html[data-theme="light"] .portal-secondary-action { border-color: rgba(105, 133, 164, 0.28); background: rgba(255, 255, 255, 0.72); color: #2b3b55; }
html[data-theme="light"] .portal-secondary-action:hover { background: rgba(15, 159, 145, 0.07); color: #126e6c; }

@media (max-width: 767px) {
    .portal-home-shell { padding-top: 0.25rem; }
    .portal-home-card { border-radius: 1.35rem; }
    .portal-home-content { grid-template-columns: 1fr; gap: 2rem; padding: 1.5rem; }
    .portal-home-card h1 { margin-top: 1.35rem; font-size: clamp(2rem, 10vw, 3rem); }
    .portal-home-description { line-height: 1.6; }
    .portal-home-actions { align-items: stretch; flex-direction: column; }
    .portal-primary-action, .portal-secondary-action { width: 100%; justify-content: center; }
    .portal-access-panel { border-top: 1px solid rgba(133, 159, 184, 0.2); border-left: 0; padding: 2rem 0 0; }
    .portal-robot-frame { width: 10.5rem; }
    .portal-access-copy { max-width: none; }
    .portal-logged-out-state { padding: 2rem 1.5rem; }
}
