:root {
    --primary: #7f5bd6;
    --primary-dark: #6947c4;
    --primary-soft: #efe7ff;

    --bg: #f6f3fb;
    --bg-strong: #ece5f7;
    --card: #ffffff;

    --text: #463b67;
    --text-soft: #7f7698;
    --border: #e2d9f3;

    --success-bg: #e9f8ef;
    --success-text: #237548;
    --danger-bg: #fdeaea;
    --danger-text: #b23a3a;
    --warning-bg: #fff5df;
    --warning-text: #9c6f09;
    --info-bg: #eef4ff;
    --info-text: #355caa;

    --shadow: 0 18px 45px rgba(103, 76, 168, 0.10);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-pill: 999px;

    --container: 1180px;
    --header-height: 86px;
    --footer-height: 64px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: 'Nunito', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100%;
}

body {
    min-height: 100vh;
}

.page-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at top left, rgba(206, 187, 249, 0.25), transparent 25%),
        radial-gradient(circle at bottom right, rgba(233, 214, 255, 0.22), transparent 24%),
        linear-gradient(180deg, #faf8fd 0%, #f5f1fa 100%);
}

/* ========= Header ========= */
.site-header {
    width: 100%;
    background: #dbcdf1;
    border-bottom: 1px solid #d5c5ec;
    min-height: var(--header-height);
    display: flex;
    align-items: center;
}

.site-header__inner {
    width: 100%;
    max-width: 100%;
    padding: 0 18px 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.site-header__brand {
    display: flex;
    align-items: center;
}

.brand-link {
    text-decoration: none;
    font-size: 1.15rem;
    font-weight: 800;
    color: #5b2ea1;
    letter-spacing: -0.02em;
}

.brand-link:hover {
    opacity: 0.9;
}

.site-header__actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6b4fc2;
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1;
    width: 24px;
    height: 24px;
}

.header-icon-link:hover {
    opacity: 0.8;
}

/* ========= Main ========= */
.register-main {
    flex: 1;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 24px 20px 36px;
}

.register-wrapper {
    width: 100%;
    max-width: 980px;
}

/* ========= Topo interno ========= */
.register-topbar {
    display: grid;
    grid-template-columns: 140px 1fr 120px;
    align-items: center;
    gap: 18px;
    margin-bottom: 24px;
}

.back-btn,
.logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-width: 96px;
    height: 42px;
    padding: 0 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.75);
    color: var(--text);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 700;
    transition: 0.2s ease;
    backdrop-filter: blur(8px);
}

.back-btn:hover,
.logout-btn:hover {
    background: #fff;
    border-color: #d5c4ef;
    transform: translateY(-1px);
}

.logout-btn {
    justify-self: end;
    color: var(--primary-dark);
}

.register-title-block {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: left;
}

.register-title-text {
    text-align: center;
}

.section-kicker {
    margin: 0 0 2px;
    font-size: 0.84rem;
    font-weight: 800;
    color: #8b80a5;
    letter-spacing: 0.08em;
}

.register-title-text h1 {
    margin: 0;
    font-size: 1.9rem;
    line-height: 1.05;
    color: var(--text);
    font-weight: 800;
}

/* ========= Card ========= */
.register-card {
    width: 100%;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid #e6ddf5;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    padding: 28px 28px 26px;
}

.register-card__intro {
    margin-bottom: 20px;
}

.badge-soft {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 0.84rem;
    font-weight: 800;
    margin-bottom: 14px;
}

.register-card__intro h2 {
    margin: 0 0 8px;
    font-size: 2rem;
    line-height: 1.15;
    color: var(--text);
    font-weight: 800;
}

.register-card__intro p {
    margin: 0;
    color: var(--text-soft);
    font-size: 1rem;
    line-height: 1.55;
}

/* ========= Flash ========= */
.flash-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 18px 0 22px;
}

.flash-message {
    border-radius: 14px;
    padding: 14px 16px;
    font-weight: 700;
    line-height: 1.45;
    border: 1px solid transparent;
}

.flash-success {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: #cfead9;
}

.flash-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
    border-color: #f0c3c3;
}

.flash-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
    border-color: #f3dfb0;
}

.flash-info {
    background: var(--info-bg);
    color: var(--info-text);
    border-color: #d6e4ff;
}

/* ========= Form ========= */
.register-form {
    width: 100%;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group--full {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text);
}

.form-group input,
.form-group select {
    width: 100%;
    height: 54px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #fff;
    color: var(--text);
    padding: 0 16px;
    font-size: 1rem;
    outline: none;
    transition: 0.2s ease;
    box-shadow: none;
}

.form-group input::placeholder {
    color: #a296bc;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #b89df0;
    box-shadow: 0 0 0 4px rgba(150, 110, 232, 0.12);
}

.input-with-action {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.toggle-password {
    height: 54px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #fff;
    color: var(--primary-dark);
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    transition: 0.2s ease;
}

.toggle-password:hover {
    background: var(--primary-soft);
    border-color: #cab7f2;
}

.hint {
    font-size: 0.84rem;
    color: var(--text-soft);
    line-height: 1.4;
}

.form-footer {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #efe7f8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.form-note {
    max-width: 480px;
    color: var(--text-soft);
    font-size: 0.95rem;
    line-height: 1.55;
}

.submit-btn {
    min-width: 230px;
    height: 54px;
    border: none;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 14px 24px rgba(110, 76, 191, 0.22);
    transition: 0.2s ease;
}

.submit-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ========= Footer ========= */
.site-footer {
    border-top: 1px solid #d8caee;
    background: rgba(245, 241, 251, 0.9);
    min-height: var(--footer-height);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
}

.site-footer__inner {
    width: 100%;
    text-align: center;
    color: #6946bf;
    font-size: 0.94rem;
    line-height: 1.5;
    font-weight: 700;
}

.footer-dot {
    margin: 0 10px;
    color: #9e8acb;
}

/* ========= Responsivo ========= */
@media (max-width: 900px) {
    .register-topbar {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .logout-btn {
        justify-self: center;
    }

    .register-title-block {
        justify-content: center;
        text-align: center;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group--full {
        grid-column: auto;
    }

    .form-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .form-note {
        max-width: none;
    }

    .submit-btn {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 640px) {
    .site-header__inner {
        padding: 0 12px;
    }

    .site-header__actions {
        gap: 10px;
    }

    .register-main {
        padding: 18px 12px 28px;
    }

    .register-card {
        padding: 22px 18px;
        border-radius: 22px;
    }

    .register-card__intro h2 {
        font-size: 1.7rem;
    }

    .register-title-text h1 {
        font-size: 1.55rem;
    }

    .back-btn,
    .logout-btn {
        min-width: 92px;
        height: 40px;
        padding: 0 14px;
    }

    .input-with-action {
        grid-template-columns: 1fr;
    }

    .toggle-password {
        width: 100%;
    }

    .site-footer__inner {
        font-size: 0.86rem;
    }
}