/* Portal access landing — Beacon 1 gateway */

:root {
    --portal-gold: #c5a059;
    --portal-gold-light: #e8d4a8;
    --portal-gold-muted: rgba(197, 160, 89, 0.28);
    --portal-navy: #0a1f33;
    --portal-cream: #fdf9f3;
}

body.crm-portal-access-page {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    font-family: var(--font-body, 'Inter', sans-serif);
    color: var(--portal-navy);
    background: var(--portal-cream);
    position: relative;
    overflow-x: hidden;
}

.crm-portal-access-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.crm-portal-access-bg__wave {
    position: absolute;
    top: 0;
    height: 100%;
    width: min(32vw, 220px);
    color: var(--portal-gold-muted);
}

.crm-portal-access-bg__wave--left {
    left: 0;
}

.crm-portal-access-bg__wave--right {
    right: 0;
}

.crm-portal-access-wrap {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding:
        max(2rem, env(safe-area-inset-top))
        max(1.5rem, env(safe-area-inset-right))
        max(2rem, env(safe-area-inset-bottom))
        max(1.5rem, env(safe-area-inset-left));
    position: relative;
    z-index: 1;
}

.crm-portal-access-card {
    background: #fff;
    border-radius: 16px;
    padding: 2.75rem 2.5rem 2.25rem;
    box-shadow:
        0 4px 12px rgba(10, 31, 51, 0.05),
        0 20px 50px rgba(10, 31, 51, 0.09);
    border: none;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-sizing: border-box;
}

/* Logo on portal access / login cards */
.crm-portal-access-logo-wrap {
    margin: 0 auto 1.25rem;
    width: 5rem;
    height: 5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crm-portal-access-logo,
.crm-portal-access-logo-wrap .crm-brand-logo-mark {
    display: block;
    width: 5rem;
    height: 5rem;
    object-fit: contain;
}

.crm-portal-access-card h1 {
    font-family: var(--font-display, 'Playfair Display', Georgia, serif);
    font-size: 1.625rem;
    font-weight: 700;
    margin: 0 0 0.45rem;
    color: var(--portal-navy);
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.crm-portal-access-message {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0 auto 1.15rem;
    max-width: 17.5rem;
}

.crm-portal-access-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    width: 100%;
    margin: 0 0 1.35rem;
}

.crm-portal-access-divider__line {
    flex: 1;
    height: 1px;
    background: var(--portal-gold-light);
    opacity: 0.65;
}

.crm-portal-access-divider__ornament {
    color: var(--portal-gold);
    display: flex;
    align-items: center;
    flex-shrink: 0;
    line-height: 0;
}

.crm-portal-access-links {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin-bottom: 1.35rem;
    width: 100%;
}

.crm-portal-access-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 48px;
    padding: 0.75rem 1.15rem;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 500;
    font-family: inherit;
    text-decoration: none;
    border: 1px solid transparent;
    box-sizing: border-box;
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.crm-portal-access-btn__start {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
    text-align: left;
}

.crm-portal-access-btn__icon {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 1.25rem;
    flex-shrink: 0;
    font-size: 0.9375rem;
    line-height: 1;
}

.crm-portal-access-btn__label {
    white-space: nowrap;
    line-height: 1.2;
}

.crm-portal-access-btn__chev {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 0.75rem;
    font-size: 0.6875rem;
    line-height: 1;
    margin-left: 0.75rem;
    opacity: 0.9;
}

.crm-portal-access-btn--primary {
    background: var(--portal-navy);
    color: #fff;
    border-color: var(--portal-navy);
}

.crm-portal-access-btn--primary:hover,
.crm-portal-access-btn--primary:focus-visible {
    background: #123a5c;
    border-color: #123a5c;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(10, 31, 51, 0.2);
    color: #fff;
}

.crm-portal-access-btn--admin {
    background: #fff;
    color: var(--portal-navy);
    border-color: var(--portal-gold);
    margin-top: 0.15rem;
}

.crm-portal-access-btn--admin .crm-portal-access-btn__icon,
.crm-portal-access-btn--admin .crm-portal-access-btn__chev {
    color: var(--portal-gold);
}

.crm-portal-access-btn--admin:hover,
.crm-portal-access-btn--admin:focus-visible {
    background: #fffdf8;
    border-color: #b8924a;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(197, 160, 89, 0.15);
    color: var(--portal-navy);
}

.crm-portal-access-language {
    display: flex;
    justify-content: center;
    margin-top: 0.25rem;
}

.crm-portal-access-language .crm-language-flag {
    border-color: #e6e6e6;
    background: #faf7f2;
}

.crm-portal-access-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin-top: 1rem;
    padding: 0.5rem 0.95rem;
    border-radius: 9999px;
    background: #e8f5ec;
    border: 1px solid #b8dfc4;
    color: #1f6b3a;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1;
}

.crm-portal-access-status__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2d8a4e;
    flex-shrink: 0;
}

@media (max-width: 420px) {
    .crm-portal-access-wrap {
        align-items: center;
    }

    .crm-portal-access-card {
        padding: 2.25rem 1.35rem 1.85rem;
        max-width: 100%;
    }

    .crm-portal-access-logo-wrap {
        width: 4.5rem;
        height: 4.5rem;
    }

    .crm-portal-access-logo,
    .crm-portal-access-logo-wrap .crm-brand-logo-mark {
        width: 4.5rem;
        height: 4.5rem;
    }

    .crm-portal-access-card h1 {
        font-size: 1.5rem;
    }

    .crm-portal-access-message {
        font-size: 0.8125rem;
        max-width: 16rem;
    }

    .crm-portal-access-btn {
        padding: 0.8rem 1rem;
        font-size: 0.875rem;
    }

    .crm-portal-access-btn__label {
        white-space: normal;
    }

    .crm-portal-access-bg__wave {
        width: min(24vw, 90px);
    }
}
