/* 注册页面样式 - register.css */

.register-screen {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ====== 左侧品牌面板（复用 login 结构，注册页有独特装饰） ====== */
.register-screen .brand-panel::before {
    background: radial-gradient(circle, rgba(0, 184, 148, 0.25) 0%, transparent 70%);
    top: -100px;
    right: -150px;
}

.register-screen .brand-panel::after {
    background: radial-gradient(circle, rgba(162, 155, 254, 0.2) 0%, transparent 70%);
    bottom: -120px;
    left: -80px;
}

/* ====== 注册表单面板 - 滚动支持 ====== */
.register-screen .form-panel {
    overflow-y: auto;
    padding: 40px 40px 80px;
}

.register-screen .form-wrapper {
    max-width: 400px;
}

/* ====== 邮箱行（输入 + 后缀选择） ====== */
.email-row {
    display: flex;
    gap: 0;
    align-items: stretch;
}

.email-row .field-input {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    border-right: none;
    flex: 1;
    min-width: 0;
}

.email-row .field-input:focus {
    z-index: 2;
    position: relative;
    border-right: 2px solid var(--accent);
}

.email-row .field-input.has-error {
    border-right: 2px solid var(--red);
    z-index: 2;
    position: relative;
}

/* 后缀下拉 */
.suffix-select {
    position: relative;
    flex-shrink: 0;
    min-width: 100px;
}

.suffix-trigger {
    height: 48px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    background: var(--surface-alt);
    border: 2px solid transparent;
    border-left: 1px solid var(--divider);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.25s var(--ease-out), background 0.25s var(--ease-out);
}

.suffix-trigger:hover {
    background: #fff;
}

.suffix-trigger.open {
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.suffix-arrow {
    width: 16px;
    height: 16px;
    stroke: var(--text-muted);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.25s var(--ease-out);
}

.suffix-trigger.open .suffix-arrow {
    transform: rotate(180deg);
}

.suffix-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 28px rgba(0,0,0,0.14);
    z-index: 100;
    overflow: hidden;
    animation: dropIn 0.2s var(--ease-out);
}

@keyframes dropIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.97); }
}

.suffix-option {
    padding: 12px 14px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
    color: var(--text-primary);
}

.suffix-option:hover {
    background: var(--surface-alt);
}

.suffix-option.active {
    background: rgba(108, 92, 231, 0.08);
    color: var(--accent);
    font-weight: 600;
}

/* ====== 验证码行 ====== */
.code-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.code-row .field-input {
    flex: 1;
    min-width: 0;
}

.btn-send-code {
    flex-shrink: 0;
    height: 48px;
    padding: 0 18px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: var(--accent);
    background: rgba(108, 92, 231, 0.08);
    border: 2px solid rgba(108, 92, 231, 0.2);
    border-radius: var(--radius-md);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s var(--ease-out);
}

.btn-send-code:hover:not(:disabled) {
    background: rgba(108, 92, 231, 0.14);
    border-color: var(--accent);
}

.btn-send-code:active:not(:disabled) {
    transform: scale(0.97);
}

.btn-send-code:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ====== 自定义复选框 ====== */
.checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
}

.checkbox-input {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--divider);
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s var(--ease-out);
}

.checkbox-input:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.checkbox-input:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label {
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.checkbox-label a {
    color: var(--accent);
    font-weight: 500;
}

/* ====== 注册按钮 ====== */
.btn-register {
    width: 100%;
    height: 48px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    cursor: pointer;
    transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-register:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-register:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.btn-register:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-register .btn-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

/* ====== Turnstile 验证弹窗 ====== */
.captcha-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 99990;
    animation: overlayIn 0.2s var(--ease-out);
}

.captcha-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 24px;
    z-index: 99991;
    box-shadow: 0 24px 64px rgba(0,0,0,0.2);
    animation: dialogPop 0.3s var(--ease-spring);
    max-width: 360px;
    width: calc(100vw - 40px);
}

.captcha-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.captcha-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.captcha-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-alt);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s;
}

.captcha-close:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.captcha-close svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#turnstile-container {
    display: flex;
    justify-content: center;
    min-height: 65px;
}

/* ====== 响应式 ====== */
@media (max-width: 900px) {
    .register-screen {
        flex-direction: column;
    }

    .register-screen .brand-panel {
        flex: none;
        padding: 40px 24px 28px;
    }

    .register-screen .form-panel {
        flex: 1;
        padding: 32px 24px 80px;
    }
}

@media (max-width: 480px) {
    .register-screen .form-panel {
        padding: 24px 20px 72px;
    }

    .suffix-trigger {
        height: 44px;
        padding: 0 10px;
        font-size: 13px;
        min-width: unset;
    }

    .suffix-select {
        min-width: 80px;
    }

    .code-row .field-input,
    .btn-send-code {
        height: 44px;
    }

    .btn-register {
        height: 44px;
        font-size: 14px;
    }
}
