/* Base resets */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', 'PingFang SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Shared container + two-column layout */
.xuanxue-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    gap: 48px;
    padding: 0;
    justify-content: flex-start;
}

.login-section,
.register-section,
.reset-section {
    flex: 1 1 55%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 100vh;
    background: url("../images/login-background.png") no-repeat left center;
    background-size: cover;
    padding: 40px 0;
    box-sizing: border-box;
    min-width: 0;
}

.login-content,
.register-content,
.reset-content {
    width: 100%;
    max-width: 560px;
    padding: 0 74px;
}

/* Shared logo + headings */
.logo {
    width: 48px;
    height: 48px;
    background: #000000;
    border-radius: 12px;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.welcome-title {
    font-size: 32px;
    font-weight: bold;
    line-height: 1.3;
    color: rgba(0, 0, 0, 0.85);
    margin-bottom: 8px;
}

.welcome-subtitle {
    font-size: 16px;
    line-height: 26px;
    color: rgba(0, 0, 0, 0.85);
    margin-bottom: 40px;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    font-size: 14px;
    line-height: 26px;
    color: rgba(0, 0, 0, 0.85);
    transition: all 0.3s;
}

.form-input::placeholder {
    color: rgba(0, 0, 0, 0.45);
}

.form-input:focus {
    outline: none;
    border-color: rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.5);
}

.eye-icon,
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    cursor: pointer;
    opacity: 0.45;
    transition: opacity 0.3s;
}

.eye-icon:hover,
.password-toggle:hover {
    opacity: 0.85;
}

.eye-icon img,
.password-toggle img {
    width: 100%;
    height: 100%;
}

.forgot-password {
    text-align: right;
    margin-top: 12px;
    margin-bottom: 24px;
}

.forgot-password a {
    font-size: 14px;
    line-height: 26px;
    color: rgba(0, 0, 0, 0.45);
    text-decoration: none;
    transition: color 0.3s;
}

.forgot-password a:hover {
    color: rgba(0, 0, 0, 0.85);
}

.form-error,
.error-message {
    font-size: 14px;
    line-height: 24px;
    color: #ff3b30;
    margin-top: 4px;
}

.form-error--global {
    background: rgba(217, 48, 37, 0.04);
    border-left: 4px solid #d93025;
    color: #d93025;
    padding: 10px;
    margin-bottom: 12px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.4;
}

.form-help {
    font-size: 14px;
    line-height: 22px;
    color: rgba(0, 0, 0, 0.6);
    margin-top: 8px;
}

.form-help.success {
    color: #1a7f37;
}

.form-help.error {
    color: #d93025;
}

.input-error {
    border-color: #ff3b30 !important;
}

.shake {
    animation: shake 0.3s ease;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    50% { transform: translateX(4px); }
    75% { transform: translateX(-4px); }
    100% { transform: translateX(0); }
}

/* Buttons */
.button-group {
    display: flex;
    gap: 16px;
    margin-top: 40px;
}

.btn {
    height: 40px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    flex: 1;
    background: #69A492;
    color: rgba(255, 255, 255, 0.85);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 4px solid #BFBFBF;
}

.btn-primary:hover {
    background: #69A492;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-primary img {
    width: 12px;
    height: 12px;
}

.btn-secondary {
    flex: 1;
    background: #ffffff;
    color: rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.15);
    padding: 0;
}

.btn-secondary:hover {
    border-color: rgba(0, 0, 0, 0.3);
    background: rgba(0, 0, 0, 0.02);
}

.btn:focus,
.btn a:focus {
    outline: 3px solid rgba(102, 153, 255, 0.18);
    outline-offset: 2px;
}

.btn-spinner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* Register specific */
.subscribe-checkbox {
    margin: 16px 0;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    position: relative;
}

.checkbox-container input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: relative;
    height: 20px;
    width: 20px;
    background-color: transparent;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    flex-shrink: 0;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox-container:hover .checkmark {
    border-color: rgba(0, 0, 0, 0.45);
}

.checkbox-container input[type="checkbox"]:checked ~ .checkmark {
    background-color: #000000;
    border-color: #000000;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 3px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input[type="checkbox"]:checked ~ .checkmark:after {
    display: block;
}

.checkbox-text {
    font-size: 16px;
    line-height: 24px;
    color: rgba(0, 0, 0, 0.85);
    flex: 1;
}

.terms-text {
    font-size: 16px;
    line-height: 24px;
    color: rgba(0, 0, 0, 0.85);
    margin-bottom: 24px;
    margin-left: 28px;
}

.terms-text a {
    color: #0278ff;
    text-decoration: underline;
    transition: opacity 0.3s;
}

.terms-text a:hover {
    opacity: 0.8;
}

/* Forgot password adjustments */
body.forgot-password-page .reset-content {
    max-width: 588px;
}

body.forgot-password-page .welcome-subtitle {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}

body.forgot-password-page .welcome-subtitle .welcome-icon {
    display: inline-block;
    max-width: 56px;
    height: auto;
    flex: 0 0 auto;
    flex-shrink: 0;
}

body.forgot-password-page .welcome-subtitle .welcome-text {
    flex: 1 1 auto;
    line-height: 1.2;
}

body.forgot-password-page .button-group {
    width: 100%;
    max-width: 100%;
    gap: 16px;
}

body.forgot-password-page .btn {
    box-sizing: border-box;
}

body.forgot-password-page .btn-secondary .go-href {
    display: block;
    width: 100%;
    height: 100%;
    line-height: 40px;
    text-decoration: none;
    color: inherit;
}

.resend-area {
    display: none;
}

/* Reset password (rp) page */
body.reset-password-page .xuanxue-container {
    flex-direction: column;
    gap: 48px;
}

body.reset-password-page .language-selector {
    position: absolute;
    top: 16px;
    right: 49px;
    left:auto;
    z-index: 10;
}

body.reset-password-page .logo {
    position: absolute;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    width: 72px;
    height: 72px;
    z-index: 5;
}

body.reset-password-page .main-content {
    margin: 0 auto;
    width: 400px;
    max-width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

body.reset-password-page .title {
    font-weight: bold;
    font-size: 32px;
    color: rgba(0, 0, 0, 0.85);
    text-align: center;
}

body.reset-password-page .form-group {
    width: 100%;
    margin-bottom: 24px;
}

body.reset-password-page .form-group label {
    display: block;
    font-weight: 500;
    font-size: 14px;
    color: #1b1b1b;
    margin-bottom: 12px;
}

body.reset-password-page .form-group input {
    width: 100%;
    height: 40px;
    padding: 7px 40px 7px 12px;
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    font-size: 14px;
    line-height: 26px;
    color: rgba(0, 0, 0, 0.85);
    transition: border-color 0.3s;
}

body.reset-password-page .form-group input:focus {
    border-color: rgba(0, 0, 0, 0.3);
}

body.reset-password-page .submit-btn {
    width: 100%;
    height: 48px;
    margin-top: 33px;
    background: #69A492;
    border: 4px solid #bfbfbf;
    border-radius: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.85);
    transition: background 0.3s, transform 0.2s;
}

body.reset-password-page .submit-btn:hover {
    background: #69A492;
    transform: translateY(-1px);
}

body.reset-password-page .submit-btn .arrow-icon {
    width: 16px;
    height: 16px;
}

body.reset-password-page .bottom-text {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    padding-bottom: 63px;
}

body.reset-password-page .bottom-text .subtitle {
    font-size: 18px;
    line-height: 35px;
    color: #ffffff;
    margin-bottom: 12px;
}

body.reset-password-page .bottom-text .description {
    font-weight: 500;
    font-size: 28px;
    line-height: 32px;
    color: #ffffff;
    max-width: 544px;
    margin: 0 auto;
}

body.reset-password-page .hidden {
    display: none;
}

.login-section-modal{
    background: none !important;
    min-height: 0;
    padding: 0;
}
.login-section-modal .welcome-subtitle{
    margin-bottom: 20px;
}

/* Responsive tweaks */
@media (max-width: 1400px) {
    .xuanxue-container { gap: 36px; }
    .login-content,
    .register-content,
    .reset-content { padding: 0 40px; }
    .showcase-section { width: 500px; }
    .showcase-card { width: 460px; height: 652px; }
}

@media (max-width: 1024px) {
    .xuanxue-container {
        flex-direction: column;
        gap: 0;
    }

    .showcase-section { display: none; }

    .login-section,
    .register-section,
    .reset-section {
        padding: 60px 0;
        min-height: auto;
    }
    .login-section-modal{
         padding: 20px 0;
    }

    .login-content,
    .register-content,
    .reset-content {
        padding: 0 40px;
    }

}

@media (max-width: 768px) {
    .login-content,
    .register-content,
    .reset-content {
        padding: 0 20px;
    }

    .welcome-title {
        font-size: 24px;
    }

    .button-group {
        flex-direction: column;
        gap: 12px;
    }

    .button-group .btn {
        width: 100%;
        height: 40px;
        min-height: 40px;
        box-sizing: border-box;
        flex: none;
    }

    .btn-primary {
        line-height: 40px;
    }

    body.forgot-password-page .form-input {
        height: 48px;
    }

    body.reset-password-page .main-content {
        width: calc(100% - 40px);
        padding: 0 20px;
    }
}

@media (max-width: 480px) {
    .login-content,
    .register-content,
    .reset-content {
        padding: 0 16px;
    }

    .welcome-title {
        font-size: 20px;
    }

    .welcome-subtitle {
        font-size: 14px;
        margin-bottom: 40px;
    }

    .button-group {
        gap: 12px;
    }

    .button-group .btn {
        width: 100%;
        height: 40px;
    }

    body.reset-password-page .title {
        font-size: 24px;
    }

    body.reset-password-page .logo {
        top: 15%;
        left: 50%;
        width: 60px;
        height: 60px;
    }
}
