/* =========================================================
   TERRA ICON — Community Idol referral page
   ========================================================= */

.ti-referral-page {
    display: flex;
    justify-content: center;
    align-items: center;

    min-height: calc(100vh - 160px);
}

.ti-referral-shell {
    display: grid;
    grid-template-columns:
        minmax(300px, 0.9fr)
        minmax(360px, 1.1fr);

    overflow: hidden;

    width: min(100%, 1080px);
    padding: 0;

    border-color: rgba(212, 175, 55, 0.34);

    background:
        linear-gradient(
            135deg,
            rgba(18, 17, 14, 0.98),
            rgba(5, 5, 5, 0.99)
        );

    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.48),
        0 0 0 1px rgba(255, 220, 128, 0.025);
}


/* =========================================================
   Фото участницы
   ========================================================= */

.ti-referral-photo {
    position: relative;

    min-height: 680px;
    overflow: hidden;

    background:
        radial-gradient(
            circle at 50% 20%,
            rgba(212, 175, 55, 0.17),
            rgba(5, 5, 4, 0.98) 70%
        );
}

.ti-referral-photo > img {
    width: 100%;
    height: 100%;
    min-height: 680px;

    object-fit: cover;
    object-position: center top;
}

.ti-referral-photo-placeholder {
    display: grid;
    place-items: center;

    width: 100%;
    height: 100%;
    min-height: 680px;

    color: var(--color-gold-light, #e5c269);

    font-family: var(--font-display, serif);
    font-size: clamp(60px, 10vw, 110px);
}

.ti-referral-photo-overlay {
    position: absolute;
    inset: 0;

    pointer-events: none;

    background:
        linear-gradient(
            180deg,
            rgba(0, 0, 0, 0.05) 30%,
            rgba(0, 0, 0, 0.78) 100%
        );
}

.ti-referral-photo-badge {
    position: absolute;
    right: 22px;
    bottom: 22px;
    left: 22px;

    display: flex;
    gap: 10px;
    align-items: center;

    width: fit-content;
    max-width: calc(100% - 44px);
    padding: 11px 15px;

    border: 1px solid rgba(236, 196, 96, 0.45);
    border-radius: 999px;

    color: #f0d587;
    background: rgba(4, 4, 4, 0.76);

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.34);

    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);

    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ti-referral-photo-badge svg {
    width: 21px;
    height: 21px;

    flex: 0 0 auto;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* =========================================================
   Основной контент
   ========================================================= */

.ti-referral-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 30px;

    min-width: 0;
    padding: clamp(30px, 5vw, 62px);
}

.ti-referral-heading h1 {
    margin: 8px 0 18px;

    color: var(--color-text, #fff);

    font-family: var(--font-display, serif);
    font-size: clamp(42px, 5vw, 68px);
    font-weight: 500;
    line-height: 0.98;
    letter-spacing: -0.025em;
}

.ti-referral-lead {
    max-width: 620px;
    margin: 0;

    color: var(--color-muted, #b7ad96);

    font-size: clamp(16px, 2vw, 19px);
    line-height: 1.65;
}


/* =========================================================
   Информация об участнице
   ========================================================= */

.ti-referral-participant {
    display: grid;
    gap: 17px;

    padding: 19px;

    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 18px;

    background:
        linear-gradient(
            135deg,
            rgba(212, 175, 55, 0.075),
            rgba(255, 255, 255, 0.018)
        );
}

.ti-referral-participant-name {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 13px;
    align-items: center;

    min-width: 0;
}

.ti-referral-mini-icon {
    display: grid;
    place-items: center;

    width: 48px;
    height: 48px;

    border: 1px solid rgba(225, 184, 79, 0.35);
    border-radius: 50%;

    color: var(--color-gold-light, #e7c56b);
    background: rgba(212, 175, 55, 0.07);
}

.ti-referral-mini-icon svg {
    width: 24px;
    height: 24px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ti-referral-participant-name > div {
    display: grid;
    gap: 4px;

    min-width: 0;
}

.ti-referral-participant-name strong {
    overflow-wrap: anywhere;

    color: var(--color-text, #fff);

    font-family: var(--font-display, serif);
    font-size: 27px;
    font-weight: 500;
    line-height: 1;
}

.ti-referral-participant-name span {
    color: var(--color-muted, #aa9f89);
    font-size: 13px;
}

.ti-referral-participant blockquote {
    margin: 0;
    padding-top: 15px;

    border-top: 1px solid rgba(212, 175, 55, 0.15);

    color: rgba(237, 226, 197, 0.84);

    font-family: var(--font-display, serif);
    font-size: 19px;
    line-height: 1.45;
}


/* =========================================================
   Кнопки
   ========================================================= */

.ti-referral-actions {
    display: grid;
    gap: 12px;
}

.ti-referral-form {
    display: grid;
    gap: 12px;
}

.ti-referral-actions .btn {
    width: 100%;
    min-height: 54px;
}

.ti-referral-main-button {
    display: inline-flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.ti-referral-main-button svg {
    width: 23px;
    height: 23px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ti-referral-login-note {
    margin: -2px 0 2px;

    color: var(--color-muted, #a69b84);

    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}


/* =========================================================
   Пользователь уже в команде
   ========================================================= */

.ti-referral-success {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 13px;
    align-items: center;

    padding: 15px 17px;

    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 16px;

    background:
        linear-gradient(
            135deg,
            rgba(212, 175, 55, 0.12),
            rgba(212, 175, 55, 0.025)
        );
}

.ti-referral-success-icon {
    display: grid;
    place-items: center;

    width: 46px;
    height: 46px;

    border: 1px solid rgba(231, 196, 107, 0.5);
    border-radius: 50%;

    color: #f0d17b;
}

.ti-referral-success-icon svg {
    width: 25px;
    height: 25px;

    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ti-referral-success > div {
    display: grid;
    gap: 3px;
}

.ti-referral-success strong {
    color: var(--color-text, #fff);
    font-size: 16px;
}

.ti-referral-success span {
    color: var(--color-muted, #aaa08c);
    font-size: 12px;
}


/* =========================================================
   Ошибка базы
   ========================================================= */

.ti-referral-error {
    width: min(100%, 760px);
    margin-inline: auto;
    padding: clamp(28px, 6vw, 56px);
}

.ti-referral-error h1 {
    margin: 8px 0 15px;

    font-family: var(--font-display, serif);
    font-size: clamp(38px, 7vw, 64px);
    font-weight: 500;
}


/* =========================================================
   Мобильная версия
   ========================================================= */

@media (max-width: 820px) {
    .ti-referral-page {
        align-items: flex-start;
        min-height: auto;
    }

    .ti-referral-shell {
        grid-template-columns: 1fr;
    }

    .ti-referral-photo {
        min-height: 470px;
        max-height: 620px;
    }

    .ti-referral-photo > img,
    .ti-referral-photo-placeholder {
        min-height: 470px;
        max-height: 620px;
    }

    .ti-referral-content {
        padding: 30px 22px 34px;
    }

    .ti-referral-heading h1 {
        font-size: clamp(40px, 11vw, 58px);
    }
}

@media (max-width: 480px) {
    .ti-referral-page {
        padding-right: 10px;
        padding-left: 10px;
    }

    .ti-referral-shell {
        border-radius: 20px;
    }

    .ti-referral-photo {
        min-height: 400px;
        max-height: 500px;
    }

    .ti-referral-photo > img,
    .ti-referral-photo-placeholder {
        min-height: 400px;
        max-height: 500px;
    }

    .ti-referral-photo-badge {
        right: 14px;
        bottom: 14px;
        left: 14px;

        max-width: calc(100% - 28px);
    }

    .ti-referral-content {
        gap: 24px;
        padding: 27px 16px 30px;
    }

    .ti-referral-heading h1 {
        font-size: clamp(37px, 12vw, 49px);
    }

    .ti-referral-lead {
        font-size: 15px;
    }

    .ti-referral-participant {
        padding: 15px;
    }

    .ti-referral-participant-name {
        grid-template-columns: 43px minmax(0, 1fr);
        gap: 10px;
    }

    .ti-referral-mini-icon {
        width: 43px;
        height: 43px;
    }

    .ti-referral-participant-name strong {
        font-size: 23px;
    }

    .ti-referral-participant blockquote {
        font-size: 17px;
    }
}
/* =========================================================
   Этап F — состояния реферальной страницы
   ========================================================= */

.ti-referral-state {
    display: grid;
    gap: 6px;
    padding: 16px 18px;
    border: 1px solid rgba(212, 175, 55, .24);
    border-radius: 16px;
    background: rgba(212, 175, 55, .055);
}

.ti-referral-state strong {
    color: var(--color-text, #fff);
    font-size: 16px;
}

.ti-referral-state span {
    color: var(--color-muted, #aaa08a);
    font-size: 13px;
    line-height: 1.5;
}

.ti-referral-state small {
    color: var(--color-gold-light, #e7c56b);
    font-size: 12px;
}

.ti-referral-state.is-open {
    border-color: rgba(212, 175, 55, .43);
}

.ti-referral-state.is-closed,
.ti-referral-state.is-hidden,
.ti-referral-state.is-archived {
    border-color: rgba(184, 172, 145, .2);
    background: rgba(255, 255, 255, .018);
}
