/* ============================================================
   The Chinese Dragon - Página de Cadastro
   Página independente baseada no mock ornamental de registro
   ============================================================ */

:root {
    --register-bg: #060403;
    --register-gold: #e4ad44;
    --register-gold-light: #f7d487;
    --register-gold-dark: #8e5417;
    --register-red: #4b120d;
    --register-text: #f5ead4;
    --register-muted: #cfb58c;
    --auth-panel-max-width: 580px;
    --auth-display-font: "Marcellus", Georgia, "Times New Roman", serif;
    --auth-body-font: "Open Sans", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--register-bg);
    color: var(--register-text);
    font-family: var(--auth-body-font);
}

.register-page-shell {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    padding: clamp(18px, 2vw, 32px);
    background:
        radial-gradient(circle at 28% 40%, rgba(118, 31, 15, 0.38), transparent 30%),
        radial-gradient(circle at 78% 42%, rgba(224, 148, 44, 0.14), transparent 28%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.52), rgba(0, 0, 0, 0.82)),
        #080504;
}

.register-page-shell::before {
    content: "";
    position: absolute;
    inset: 14px;
    border: 1px solid rgba(218, 160, 58, 0.28);
    pointer-events: none;
    z-index: 4;
}

.register-page-corner {
    position: absolute;
    z-index: 5;
    width: 74px;
    height: 74px;
    pointer-events: none;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.92;
}

.register-page-corner-top-left {
    left: 12px;
    top: 12px;
    background-image: url("../images/register/register_corner_top_left.png");
}

.register-page-corner-top-right {
    right: 12px;
    top: 12px;
    background-image: url("../images/register/register_corner_top_right.png");
}

.register-page-corner-bottom-left {
    left: 12px;
    bottom: 12px;
    background-image: url("../images/register/register_corner_bottom_left.png");
}

.register-page-corner-bottom-right {
    right: 12px;
    bottom: 12px;
    background-image: url("../images/register/register_corner_bottom_right.png");
}

.register-layout {
    position: relative;
    z-index: 2;
    width: min(100%, 1600px);
    min-height: calc(100vh - clamp(36px, 4vw, 64px));
    margin: 0 auto;
    display: grid;
    /* Altura comum as duas pecas: 840x941 (cena) e 1176x1338 (moldura) somam 1,772 de largura por altura. */
    --auth-h: clamp(720px, min(calc(100vh - 56px), calc((100vw - 96px) / 1.772)), 860px);
    grid-template-columns: auto auto;
    justify-content: center;
    gap: 0;
    align-items: center;
}

/*
 * A proporcao vem da propria arte (840x941). Com o painel nessa proporcao, o
 * recorte de `cover` nao tem o que cortar: a cena entra inteira, com a moldura
 * lateral e a caligrafia preservadas. Antes o painel tinha altura fixa e
 * largura variavel, entao a borda direita era comida em quase toda janela.
 */
.register-visual-panel {
    position: relative;
    height: var(--auth-h);
    aspect-ratio: 840 / 941;
    overflow: hidden;
    border-radius: 2px;
    box-shadow: inset 0 0 0 1px rgba(218, 160, 58, 0.08);
}

.register-visual-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.18), transparent 34%, rgba(0, 0, 0, 0.22)),
        linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.12));
    pointer-events: none;
}

.register-visual-image {
    width: 100%;
    height: 100%;
    min-height: inherit;
    display: block;
    object-fit: cover;
    object-position: center center;
}

.register-form-panel {
    position: relative;
    align-self: center;
    height: var(--auth-h);
    aspect-ratio: 1176 / 1338;
    overflow: visible;
}

.register-form-frame {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    filter:
        drop-shadow(0 28px 40px rgba(0, 0, 0, 0.58))
        drop-shadow(0 0 16px rgba(224, 148, 44, 0.12));
}

.register-form-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 14.5% 12% 12%;
}

.register-form-heading {
    text-align: center;
    margin-bottom: 14px;
}

.register-form-heading span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 210px;
    min-height: 36px;
    padding: 0 24px;
    background:
        linear-gradient(180deg, rgba(94, 26, 18, 0.94), rgba(55, 13, 10, 0.96));
    border: 1px solid rgba(243, 191, 94, 0.72);
    color: #f4cf85;
    font-family: var(--auth-display-font);
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow:
        inset 0 0 0 1px rgba(0, 0, 0, 0.32),
        0 8px 18px rgba(0, 0, 0, 0.22);
    clip-path: polygon(8% 0%, 92% 0%, 100% 50%, 92% 100%, 8% 100%, 0% 50%);
}

.register-form-heading h1 {
    margin: 12px 0 0;
    color: #edc276;
    font-family: var(--auth-display-font);
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    line-height: 1;
    font-weight: 600;
    text-transform: uppercase;
    text-shadow:
        0 4px 14px rgba(0, 0, 0, 0.86),
        0 0 12px rgba(245, 182, 66, 0.10);
}

.register-form-heading::after {
    content: "龍";
    display: block;
    width: 260px;
    height: 22px;
    margin: 10px auto 0;
    color: #d9a13b;
    font-family: var(--auth-display-font);
    font-size: 0.9rem;
    line-height: 22px;
    background:
        linear-gradient(90deg, transparent, rgba(218, 160, 58, 0.76), transparent);
}

.register-alert {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 0.78rem;
    line-height: 1.35;
}

.register-alert-success {
    border: 1px solid rgba(105, 229, 125, 0.34);
    background: rgba(20, 80, 32, 0.28);
    color: #d9f7d5;
}

.register-alert-error {
    border: 1px solid rgba(229, 105, 80, 0.38);
    background: rgba(90, 24, 15, 0.34);
    color: #ffd7c9;
}

.register-alert-error-list {
    margin: 0;
    padding-left: 18px;
}

.register-alert-error-list li + li {
    margin-top: 4px;
}

.register-form {
    margin-top: 18px;
}

.register-field-group {
    margin-bottom: 12px;
}

.register-field-group label {
    display: block;
    margin: 0 0 5px 0;
    color: #edc276;
    font-family: var(--auth-display-font);
    font-size: 0.8rem;
    line-height: 1;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.register-input-wrap {
    position: relative;
    width: 100%;
    min-height: 40px;
    display: flex;
    align-items: center;
    border: 1px solid rgba(224, 148, 44, 0.84);
    background:
        linear-gradient(90deg, rgba(53, 12, 8, 0.96) 0, rgba(53, 12, 8, 0.96) 42px, rgba(11, 9, 8, 0.86) 42px, rgba(7, 6, 5, 0.80) 100%);
    box-shadow:
        inset 0 0 18px rgba(0, 0, 0, 0.38),
        0 8px 16px rgba(0, 0, 0, 0.16);
}

.register-input-icon {
    width: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    color: #f5bd4a;
    font-size: 1.04rem;
    line-height: 1;
    text-shadow: 0 0 8px rgba(245, 182, 66, 0.20);
}

.register-input-wrap input {
    width: 100%;
    min-height: 38px;
    border: 0;
    outline: 0;
    padding: 8px 13px;
    background: transparent;
    color: #fff1d4;
    font-family: var(--auth-body-font);
    font-size: 0.88rem;
}

.register-input-wrap input:focus {
    box-shadow: inset 0 0 0 1px rgba(245, 210, 126, 0.44);
}

.register-submit-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(100%, 454px);
    min-height: 46px;
    margin: 20px auto 14px;
    padding: 0 24px;
    border: 2px solid rgba(220, 145, 38, 0.82);
    background: linear-gradient(180deg, rgba(114, 34, 12, 0.97) 0%, rgba(68, 16, 5, 0.99) 50%, rgba(114, 34, 12, 0.97) 100%);
    color: #f4cf85;
    font-family: var(--auth-display-font);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow:
        inset 0 1px 0 rgba(255, 218, 100, 0.16),
        0 10px 22px rgba(0, 0, 0, 0.40);
    transition: transform 0.16s ease-in-out, filter 0.16s ease-in-out, background 0.16s;
}

.register-submit-button:hover {
    transform: translateY(-2px);
    background: linear-gradient(180deg, rgba(145, 44, 16, 0.99) 0%, rgba(88, 22, 7, 1) 50%, rgba(145, 44, 16, 0.99) 100%);
    filter: drop-shadow(0 14px 20px rgba(0, 0, 0, 0.32)) drop-shadow(0 0 10px rgba(245, 182, 66, 0.16));
}

.register-submit-button:focus {
    outline: 2px solid rgba(245, 182, 66, 0.56);
    outline-offset: 2px;
}

.register-submit-button span {
    display: inline;
}

.register-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    margin-top: 6px;
    padding-top: 14px;
    background:
        linear-gradient(90deg, transparent, rgba(218, 160, 58, 0.42), transparent) top center / 100% 1px no-repeat;
}

.register-links a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #e9bd6e;
    font-family: var(--auth-body-font);
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
}

.register-links a:hover {
    color: #ffdc96;
}

.register-link-icon {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(224, 148, 44, 0.72);
    border-radius: 50%;
    color: #f1be5c;
    font-family: var(--auth-display-font);
    font-size: 1rem;
}

.register-links-divider {
    width: 1px;
    height: 28px;
    background: rgba(224, 148, 44, 0.52);
}

@media (max-width: 1199.98px) {
    .register-layout {
        grid-template-columns: minmax(0, 640px);
        gap: 0;
    }

    .register-visual-panel,
    .register-form-panel {
        width: 100%;
        height: auto;
    }
}

@media (max-width: 767.98px) {
    .register-page-shell {
        padding: 14px;
    }

    .register-page-shell::before,
    .register-page-corner {
        display: none;
    }

    .register-form-panel {
        aspect-ratio: auto;
    }

    .register-form-frame {
        opacity: 0.94;
        object-fit: fill;
    }

    .register-form-content {
        height: auto;
        padding: 88px 40px 48px;
    }


    .register-links {
        flex-direction: column;
        gap: 14px;
    }

    .register-links-divider {
        display: none;
    }
}

@media (max-width: 575.98px) {
    /*
     * No telefone a cena vira uma faixa: a proporcao da arte deixaria um painel
     * altissimo. O recorte aqui e intencional e mira o dragao.
     */
    .register-visual-panel {
        aspect-ratio: 16 / 11;
    }

    .register-visual-image {
        object-position: 60% 35%;
    }

    .register-form-content {
        padding: 76px 28px 40px;
    }

    .register-form-heading h1 {
        font-size: 2rem;
    }

    .register-field-group label {
        margin-left: 0;
        font-size: 0.82rem;
    }

    .register-submit-button {
        min-height: 62px;
    }
}

/*
 * TCD-UI-LOGIN-1: moldura ornamentada em NOVE FATIAS (border-image), escala em unidades de container.
 * A arte (1176x1338) tem cantos de 175px (horizontal) e 240px (vertical). Com `cqw` cada canto acompanha a
 * LARGURA do painel (14,88cqw e 20,41cqw): o entalhe e o brasao do topo mantem a proporcao em qualquer altura,
 * e so o miolo das laterais estica. Antes, `object-fit: fill` alongava tudo (0,88 vira 0,68 no desktop e 0,44 no celular).
 * Vale so ate 767px: acima disso a moldura usa a proporcao natural da arte (ver .register-form-panel).
 */
@media (max-width: 767.98px) {
    .register-page-shell .register-form-panel {
        container-type: inline-size;
        width: min(100%, var(--auth-panel-max-width));
        min-height: 0;
    }

    .register-page-shell .register-form-frame {
        display: none;
    }

    .register-page-shell .register-form-panel::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: 1;
        pointer-events: none;
        border-style: solid;
        border-width: 20.41cqw 14.88cqw;
        border-image-source: url("../images/register/register_right_panel_limpo.png");
        border-image-slice: 240 175 fill;
        border-image-width: 20.41cqw 14.88cqw;
        border-image-repeat: stretch;
        filter: drop-shadow(0 28px 40px rgba(0, 0, 0, 0.58)) drop-shadow(0 0 16px rgba(224, 148, 44, 0.12));
    }

    .register-page-shell:not(.login-page) .register-form-content {
        min-height: 0;
        padding: 17.5cqw 13cqw 9cqw;
    }
}

@media (max-width: 767.98px) {
    .register-page-shell:not(.login-page) .register-form-content {
        min-height: 0;
        padding: 17.5cqw 12cqw 9cqw;
    }
}

@media (max-width: 575.98px) {
    .register-page-shell:not(.login-page) .register-form-content {
        padding: 17cqw 11cqw 9cqw;
    }
}

/*
 * Aceite legal do cadastro (OpenSpec 44 / LegalConsent).
 *
 * Alvo de toque minimo de 44px por opcao e contraste alto: o checkbox vive
 * dentro da moldura da pagina de cadastro, entao nao pode depender de um estilo
 * de formulario que a pagina nao carrega.
 */
.register-legal-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.register-legal-option {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    min-height: 44px;
    padding: 0.5rem 0.6rem;
    border-radius: 0.4rem;
    background: rgba(20, 16, 12, 0.55);
    color: #f4e7cf;
    font-size: 0.86rem;
    line-height: 1.3;
    cursor: pointer;
}

.register-legal-option input {
    flex: 0 0 auto;
    width: 1.15rem;
    height: 1.15rem;
    margin-top: 0.1rem;
    accent-color: #d9a13b;
}

.register-legal-option small {
    display: block;
    color: #cbb694;
    font-size: 0.75rem;
}
