/* ============================================
   GenSphere - Login Page Styles
   ============================================ */

.auth-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    overflow-x: hidden;
}

/* ===== Background ===== */
.auth-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0a0a14;
    z-index: -1;
}

.auth-bg-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 55vh;
    background: radial-gradient(ellipse 80% 50% at top center,
        rgba(79, 70, 229, 0.35) 0%,
        rgba(99, 102, 241, 0.18) 25%,
        rgba(10, 10, 20, 0) 60%);
}

.auth-bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
}

.glow-top {
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 700px;
    height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.5), transparent 70%);
}

/* ===== Page Layout ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    box-sizing: border-box;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    position: relative;
}

/* ===== Header ===== */
.auth-header {
    text-align: center;
    margin-bottom: 48px;
}

.auth-logo {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.auth-logo-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
}

.auth-logo-text-img {
    height: 32px;
    width: auto;
    display: block;
}

.auth-title {
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    letter-spacing: -0.3px;
}

/* ===== Form ===== */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.form-label {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    padding-left: 4px;
}

/* ===== Input Styles ===== */
.form-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-size: 15px;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.form-input:hover {
    background: rgba(255, 255, 255, 0.08);
}

.form-input:focus {
    background: rgba(255, 255, 255, 0.09);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

/* ===== Phone Input Group ===== */
.phone-input-group {
    display: flex;
    gap: 10px;
}

.phone-prefix {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    height: 48px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
}

.phone-prefix svg {
    width: 14px;
    height: 14px;
    color: rgba(255, 255, 255, 0.4);
}

.phone-input {
    flex: 1;
}

/* ===== Code Input Group ===== */
.code-input-group {
    display: flex;
    gap: 10px;
}

.code-input {
    flex: 1;
}

.btn-send-code {
    padding: 0 18px;
    height: 48px;
    background: rgba(99, 102, 241, 0.1);
    border: none;
    border-radius: 12px;
    color: #818cf8;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-send-code:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.18);
}

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

/* ===== Form Hint ===== */
.form-hint {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
    margin-top: -8px;
    padding-left: 4px;
}

/* ===== Submit Button ===== */
.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    background: #ffffff;
    color: #0a0a14;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(255, 255, 255, 0.15);
}

.btn-submit:active:not(:disabled) {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-submit svg {
    width: 18px;
    height: 18px;
}

/* ===== Checkbox Options ===== */
.auth-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-custom {
    width: 16px;
    height: 16px;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: #6366f1;
    border-color: #6366f1;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '';
    width: 4px;
    height: 7px;
    border: solid white;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg) translate(-0.5px, -0.5px);
}

.checkbox-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

.agreement-label {
    align-items: flex-start;
}

.agreement-label .checkbox-custom {
    margin-top: 1px;
}

.agreement-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.5;
}

.agreement-text .link-text {
    font-size: 12px;
    color: rgba(129, 140, 248, 0.9);
    text-decoration: none;
}

.agreement-text .link-text:hover {
    text-decoration: underline;
}

.link-text {
    color: #818cf8;
    text-decoration: none;
    transition: color 0.2s ease;
}

.link-text:hover {
    color: #a5b4fc;
}

/* ===== Social Section ===== */
.auth-social-section {
    margin-top: 40px;
}

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
}

.divider span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 1px;
    text-transform: lowercase;
}

.auth-social {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.social-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.social-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.social-btn svg {
    width: 20px;
    height: 20px;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .auth-page {
        padding: 20px 16px;
        padding-top: 40px;
        align-items: flex-start;
    }
    
    .auth-header {
        margin-bottom: 40px;
    }
    
    .auth-form {
        gap: 14px;
    }
    
    .form-input,
    .phone-prefix,
    .btn-send-code {
        height: 46px;
    }
    
    .btn-submit {
        height: 46px;
    }
}

@media (max-height: 700px) {
    .auth-page {
        padding: 20px;
    }
    
    .auth-header {
        margin-bottom: 32px;
    }
}

/* ===== Onboarding Pages ===== */
.onboarding-step {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.onboarding-step strong {
    color: #818cf8;
    font-weight: 600;
}

.username-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: -4px;
}

.username-suggestion {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.username-suggestion:hover {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
}

.onboarding-skip-wrap {
    text-align: center;
    margin-top: 4px;
}

.btn-skip {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.35);
    font-size: 13px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.btn-skip:hover {
    color: rgba(255, 255, 255, 0.6);
}

.auth-container-wide {
    max-width: 560px;
}

.onboarding-sub {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin: 12px 0 8px;
}

.selected-count {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
    margin: 0;
}

.selected-count strong {
    color: #818cf8;
    font-weight: 600;
}

.topic-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 24px;
    margin-bottom: 32px;
}

.topic-item {
    position: relative;
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 20px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.topic-item:hover {
    background: rgba(255, 255, 255, 0.07);
}

.topic-item.active {
    background: rgba(99, 102, 241, 0.12);
    border-color: #6366f1;
}

.topic-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #6366f1;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
}

.topic-check svg {
    width: 12px;
    height: 12px;
}

.topic-item.active .topic-check {
    opacity: 1;
    transform: scale(1);
}

.topic-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.topic-name {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
}

.topic-item.active .topic-name {
    color: #ffffff;
}

.onboarding-bottom {
    margin-top: 0;
}

@media (max-width: 480px) {
    .auth-container-wide {
        max-width: 100%;
    }
    
    .topic-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 8px 10px;
        margin-top: 20px;
        margin-bottom: 28px;
    }
    
    .topic-item {
        position: relative;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 8px 14px;
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 9999px;
        text-align: left;
        transition: all 0.2s ease;
    }
    
    .topic-item:hover {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.15);
    }
    
    .topic-item.active {
        background: rgba(99, 102, 241, 0.2);
        border-color: #6366f1;
    }
    
    .topic-check {
        position: static;
        width: 16px;
        height: 16px;
        opacity: 0;
        transform: scale(0.5);
        flex-shrink: 0;
        order: -1;
    }
    
    .topic-item.active .topic-check {
        opacity: 1;
        transform: scale(1);
    }
    
    .topic-check svg {
        width: 10px;
        height: 10px;
    }
    
    .topic-icon {
        font-size: 16px;
        margin-bottom: 0;
        order: 0;
    }
    
    .topic-name {
        font-size: 13px;
        font-weight: 500;
        color: rgba(255, 255, 255, 0.8);
        order: 1;
        white-space: nowrap;
    }
    
    .topic-item.active .topic-name {
        color: #ffffff;
        font-weight: 500;
    }
}
