html {
    overflow-x: hidden;
    height: 100%;
}

body {
    background: linear-gradient(145deg, #f0f3f7 0%, #e6eaef 100%);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
}

.login-wrapper {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}

.login-card {
    background: #ffffff;
    border-radius: 28px;
    overflow: hidden;
}

.login-card-header-bar {
    background: var(--header-background-color);
    padding: 1rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80px;
}

.header-logo {
    max-height: 50px;
    width: auto;
    object-fit: contain;
}

.header-placeholder {
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 1px;
}

.login-card-body {
    padding: 2.5rem 2rem 2rem;
}

.login-card-header {
    margin-bottom: 1.75rem;
    text-align: center;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.3px;
    color: var(--page-caption-text-color);
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--button-color);
    display: inline-block;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--label-text-color);
    margin-bottom: 0.25rem;
}

.required-star {
    color: var(--error-color);
    margin-left: 2px;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    opacity: 0.5;
    transition: opacity 0.2s;
    pointer-events: none;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 2;
}

.icon-user {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23656772' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'%3E%3C/path%3E%3Ccircle cx='12' cy='7' r='4'%3E%3C/circle%3E%3C/svg%3E");
}

.icon-lock {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23656772' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'%3E%3C/rect%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'%3E%3C/path%3E%3C/svg%3E");
}

.icon-question {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23656772' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpath d='M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3'%3E%3C/path%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'%3E%3C/line%3E%3C/svg%3E");
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 44px;
    font-size: 1rem;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    outline: none;
    transition: all 0.25s ease;
    color: #1a202c;
    font-family: inherit;
    box-sizing: border-box;
}

.form-input::placeholder {
    color: #a0aec0;
}

.form-input:hover {
    border-color: #cbd5e0;
}

.form-input:focus {
    border-color: var(--button-color);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(var(--button-color-rgb, 66, 153, 225), 0.15);
}

.form-input:focus ~ .input-icon,
.form-input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
    opacity: 1;
}

.form-input.error {
    border-color: var(--error-color);
    box-shadow: 0 0 0 4px rgba(215, 66, 75, 0.12);
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 8px;
    transition: background 0.2s;
    z-index: 2;
}

.password-toggle:hover {
    background: rgba(0, 0, 0, 0.04);
}

.visibility-icon {
    display: block;
}

.visibility-hidden {
    display: block;
}

.visibility-visible {
    display: none;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 14px;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
    cursor: pointer;
    text-transform: uppercase;
    font-family: inherit;
    text-decoration: none;
}

.btn-login {
    width: 100%;
    background: var(--button-color);
    color: var(--button-text-color);
}

.btn-login:hover {
    color: var(--button-text-color);
    background: linear-gradient(rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.08)), var(--button-color);
}

.btn-login:active {
    color: var(--button-text-color);
    background: linear-gradient(rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0.16)), var(--button-color);
}

.btn-secondary {
    background: #edf2f7;
    color: #4a5568;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.btn-secondary:hover {
    background: #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: none;
}

.btn-secondary:active {
    background: #d2d8e0;
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.captcha-actions {
    flex-direction: row;
    gap: 1rem;
}

.captcha-actions .btn {
    flex: 1;
}

.error-message {
    display: none;
    font-size: 0.85rem;
    color: var(--error-color);
    margin-top: 0.35rem;
    align-items: center;
    gap: 4px;
}

.error-message.show {
    display: flex;
}

.icon-error {
    font-weight: 700;
    margin-right: 4px;
}

.captcha-field {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.captcha-field .captcha-question {
    width: 100%;
    text-align: center;
    font-size: 2rem;
    font-weight: 600;
    padding: 1.25rem;
    background: #f5f7fa;
    border-radius: 14px;
    color: #4a5568;
    margin-bottom: 1.5rem;
    position: relative;
    user-select: none;
    background-image:
        repeating-linear-gradient(35deg, rgba(0,0,0,0.02) 0px, rgba(0,0,0,0.02) 1px, transparent 1px, transparent 15px),
        repeating-linear-gradient(-25deg, rgba(0,0,0,0.015) 0px, rgba(0,0,0,0.015) 1px, transparent 1px, transparent 20px),
        repeating-linear-gradient(90deg, rgba(0,0,0,0.015) 0px, rgba(0,0,0,0.015) 2px, transparent 2px, transparent 25px),
        radial-gradient(circle at 20% 30%, rgba(0,0,0,0.02) 1px, transparent 1px),
        linear-gradient(145deg, #f0f3f8, #fafcfd);
    background-size: auto, auto, auto, 12px 12px, auto;
    background-repeat: repeat, repeat, repeat, repeat, no-repeat;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02), 0 1px 2px rgba(0,0,0,0.03);
}

.captcha-field .captcha-question::before {
    content: "• · • · • · • · • · • · • · • · • · • · •";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    font-size: 0.9rem;
    color: rgba(0, 0, 0, 0.04);
    font-family: monospace;
    white-space: normal;
    word-break: break-all;
    line-height: 1.6;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    letter-spacing: 6px;
    transform: rotate(-0.5deg);
    z-index: 0;
}

.captcha-field .captcha-question > * {
    position: relative;
    z-index: 1;
}

.captcha-field input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    outline: none;
    transition: all 0.25s ease;
    color: #1a202c;
    text-align: center;
    font-family: inherit;
    box-sizing: border-box;
}

.captcha-field input:focus {
    border: 2px solid var(--button-color)!important;
    background: #ffffff;
}

.captcha-field input:hover {
    border-color: #cbd5e0;
}

.footer {
    background: #eaeaea;
    color: rgba(0, 0, 0, 0.7);
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
    margin-top: auto;
}

.footer .content {
    width: 100%;
    max-width: 69.5rem;
    padding: 0 1rem;
    text-align: center;
}

@media (max-width: 768px) {
    .login-card-body {
        padding: 1.75rem 1.25rem;
    }
    .login-title {
        font-size: 1.25rem;
    }
    .form-input {
        padding: 0.75rem 1rem 0.75rem 40px;
        font-size: 0.95rem;
    }
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }
    .main-content {
        padding: 1rem;
    }
    .captcha-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    .login-card-header-bar {
        min-height: 60px;
    }
    .header-logo {
        max-height: 40px;
    }
}

@media (max-width: 480px) {
    .login-card-body {
        padding: 1.5rem 1rem;
    }
    .login-title {
        font-size: 1.1rem;
    }
}