/* ==================== REGISTER ENTERPRISE STYLES ==================== */
.auth {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    min-height: 100vh;
    background: var(--bg);
}

/* ==================== ESQUERDA: BRAND PANEL ==================== */
.auth__brand {
    position: relative;
    overflow: hidden;
    padding: 54px 58px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #eaf2ec;
    background:
        radial-gradient(1100px 560px at 18% 8%, rgba(16, 185, 129, .22), transparent 58%),
        radial-gradient(820px 460px at 92% 96%, rgba(16, 185, 129, .14), transparent 55%),
        linear-gradient(155deg, #090e0b 0%, #0c1510 46%, #070f0a 100%);
}

.auth__brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(circle at 26% 36%, #000 0%, transparent 75%);
    mask-image: radial-gradient(circle at 26% 36%, #000 0%, transparent 75%);
    opacity: .8;
}

.auth__orb {
    position: absolute;
    width: 460px;
    height: 460px;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .35;
    background: radial-gradient(circle, rgba(16, 185, 129, .75), transparent 68%);
    animation: drift 16s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
}
.auth__orb--a { top: -100px; left: -60px; }
.auth__orb--b { bottom: -140px; right: -40px; width: 500px; height: 500px; animation-duration: 22s; animation-direction: reverse; opacity: .25; }

@keyframes drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(25px, 20px) scale(1.05); }
}

.brand__top, .brand__mid, .brand__bottom { position: relative; z-index: 1; }

.brand__logo {
    display: flex;
    align-items: center;
    gap: 14px;
}
.brand__logo img { width: 44px; height: 44px; }
.brand__logo b { font-size: 21px; font-weight: 700; letter-spacing: -0.2px; color: #ffffff; }
.brand__logo span { display: block; font-size: 11px; color: #86efac; font-weight: 600; letter-spacing: 1.3px; text-transform: uppercase; margin-top: 2px; }

.brand__mid { max-width: 480px; }

.brand__kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .3px;
    color: #6ee7b7;
    background: rgba(16, 185, 129, .14);
    border: 1px solid rgba(16, 185, 129, .28);
    padding: 5px 14px;
    border-radius: 100px;
    margin-bottom: 20px;
}
.brand__kicker .dot { width: 7px; height: 7px; border-radius: 50%; background: #10b981; }

.brand__title {
    font-size: 34px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -.6px;
    margin: 0 0 16px;
    color: #ffffff;
}
.brand__highlight { color: #10b981; }

.brand__sub {
    font-size: 14.5px;
    line-height: 1.6;
    color: #cbd5e1;
    margin: 0 0 20px;
}

.brand__btn-help {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #e2e8f0;
    border-radius: 8px;
    padding: 8px 20px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.brand__btn-help:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: #10b981;
    color: #ffffff;
}

.brand__bottom { font-size: 12px; color: #64748b; }

/* ==================== DIREITA: FORM PANEL ==================== */
.auth__panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: var(--bg);
    overflow-y: auto;
}

.auth__top {
    position: absolute;
    top: 20px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 50;
}

.lang-switch { position: relative; }
.lang-btn {
    height: 38px; padding: 0 13px; border-radius: 10px;
    display: flex; align-items: center; gap: 7px;
    background: var(--card); border: 1px solid var(--input-bd); color: var(--muted);
    cursor: pointer; font-size: 13px; font-weight: 700; font-family: inherit; transition: .18s;
}
.lang-btn:hover { color: var(--text-heading); border-color: var(--green); }
.lang-btn .globe { width: 16px; height: 16px; }
.lang-btn .chev { width: 12px; height: 12px; opacity: .7; }
.lang-menu {
    position: absolute; top: 46px; right: 0; min-width: 160px;
    background: var(--card); border: 1px solid var(--input-bd); border-radius: 12px;
    box-shadow: var(--shadow); padding: 6px; display: none; z-index: 100;
}
.lang-menu.open { display: block; animation: rise .18s ease both; }
.lang-menu a {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; border-radius: 8px; font-size: 13px;
    color: var(--text); text-decoration: none;
    transition: background 0.12s ease;
}
.lang-menu a:hover { background: var(--card-2); color: var(--text-heading); }
.lang-menu a.active { color: var(--green); font-weight: 600; }
.lang-menu a .fl { font-size: 15px; line-height: 1; }

.theme-toggle {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--card);
    border: 1px solid var(--input-bd);
    color: var(--muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    padding: 0;
}
.theme-toggle:hover {
    background: var(--card-hover);
    color: var(--text-heading);
    border-color: var(--green);
}
.theme-toggle svg { width: 18px; height: 18px; }
.ico-sun, .ico-moon { display: none; }
html[data-theme="dark"] .ico-sun { display: block; }
html[data-theme="light"] .ico-moon { display: block; }

/* ==================== CARD PRINCIPAL ==================== */
.card {
    width: 100%;
    max-width: 480px;
    background: var(--card);
    border: 1px solid var(--input-bd);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 34px 34px 28px;
    animation: rise .35s ease both;
    box-sizing: border-box;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card__head { margin-bottom: 22px; }
.card h1 {
    font-size: 21px;
    font-weight: 700;
    margin: 0;
    color: var(--text-heading);
    letter-spacing: -0.3px;
}

/* ==================== CAMPOS DE FORMULÁRIO ==================== */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.field__label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.1px;
}

.input-wrap {
    position: relative;
    width: 100%;
}

.register-form input[type="text"],
.register-form input[type="email"],
.register-form input[type="password"],
.register-form select {
    width: 100%;
    height: 42px;
    background: var(--input-bg);
    color: var(--input-text);
    border: 1px solid var(--input-bd);
    border-radius: 8px;
    padding: 0 14px;
    font-size: 13.5px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.register-form input:not(#phone):not(#countrySearch):focus,
.register-form select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px var(--ring);
}

.field__select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding-right: 36px !important;
}

.field__select-chev {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--muted);
    pointer-events: none;
}

.field__eye {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.15s ease;
}
.field__eye:hover { color: var(--text-heading); }
.field__eye .eye-off { display: none; }
.field__eye.is-on .eye-on { display: none; }
.field__eye.is-on .eye-off { display: block; }

/* ==================== TELEFONE COM COUNTRY PICKER UNIFICADO ==================== */
.phone-group {
    display: flex;
    align-items: center;
    width: 100%;
    height: 42px;
    background: var(--input-bg);
    border: 1px solid var(--input-bd);
    border-radius: 8px;
    transition: border-color .15s ease, box-shadow .15s ease;
    position: relative;
    box-sizing: border-box;
}

.phone-group:focus-within {
    border-color: var(--green) !important;
    box-shadow: 0 0 0 3px var(--ring) !important;
}

.country-picker {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.country-btn {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px 0 12px;
    background: transparent;
    border: none;
    border-right: 1px solid var(--divider, var(--input-bd));
    cursor: pointer;
    color: var(--text-heading);
    transition: background-color 0.15s ease;
    outline: none;
}
.country-btn:hover {
    background: var(--card-hover);
}

.country-flag {
    font-size: 18px;
    line-height: 1;
}

.country-chev {
    width: 12px;
    height: 12px;
    color: var(--muted);
}

.phone-group #phone {
    flex: 1;
    height: 100% !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 14px !important;
    color: var(--input-text) !important;
    font-size: 13.5px !important;
    outline: none !important;
    border-radius: 0 8px 8px 0 !important;
}

.country-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 320px;
    max-height: 280px;
    background: var(--card);
    border: 1px solid var(--input-bd);
    border-radius: 12px;
    box-shadow: var(--shadow);
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow: hidden;
}
.country-dropdown.open { display: flex; }

.country-search-wrap {
    padding: 8px 10px;
    border-bottom: 1px solid var(--divider);
    background: var(--card-2);
}
.country-search-wrap input {
    width: 100%;
    height: 34px !important;
    font-size: 12.5px !important;
    border-radius: 6px !important;
    padding: 0 10px !important;
    background: var(--input-bg) !important;
    border: 1px solid var(--input-bd) !important;
    color: var(--input-text) !important;
}

.country-list {
    overflow-y: auto;
    max-height: 220px;
    padding: 4px 0;
}
.country-list::-webkit-scrollbar { width: 5px; }
.country-list::-webkit-scrollbar-thumb { background: rgba(120, 130, 140, 0.3); border-radius: 4px; }

.country-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
    transition: background 0.12s ease;
}
.country-item:hover, .country-item.selected {
    background: var(--card-hover);
    color: var(--text-heading);
}
.country-item .country-item-flag { font-size: 16px; }
.country-item .country-item-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.country-item .country-item-dial { color: var(--muted); font-size: 12px; font-family: monospace; }

/* ==================== BOTÃO DE SUBMISSÃO & FOOTER ==================== */
.btn-primary {
    width: 100%;
    height: 44px;
    border: none;
    border-radius: 8px;
    background: var(--green, #10b981);
    color: #ffffff !important;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 4px 14px var(--green-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    outline: none;
}
.btn-primary:hover {
    background: var(--green-hover, #059669);
    color: #ffffff !important;
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}

.card__foot-link {
    text-align: center;
    margin-top: 18px;
    font-size: 13px;
    color: var(--muted);
}
.card__foot-link a {
    color: var(--green);
    text-decoration: none;
    font-weight: 600;
}
.card__foot-link a:hover {
    text-decoration: underline;
}

/* ==================== MENSAGENS DE SUCESSO / ERRO ==================== */
.error-message {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

.token-modal {
    background: var(--card-2);
    border: 1px solid var(--green);
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 16px;
    text-align: center;
}
.token-code {
    font-family: monospace;
    font-size: 16px;
    font-weight: 700;
    color: var(--green);
    letter-spacing: 1.5px;
    background: var(--input-bg);
    padding: 10px 14px;
    border-radius: 8px;
    margin: 12px 0;
    border: 1px dashed var(--input-bd);
}

/* ==================== RESPONSIVIDADE ==================== */
@media (max-width: 960px) {
    .auth { grid-template-columns: 1fr; }
    .auth__brand { display: none; }
    .auth__panel { padding: 60px 16px 30px; }
    .card { padding: 26px 20px 22px; }
}
