:root {
    --antt-primary: #16697a;
    --antt-primary-hover: #0f5563;
    --antt-text: #172033;
    --antt-muted: #6b7280;
    --antt-border: #dce2e8;
    --antt-panel-width: min(46vw, 680px);
    --antt-form-width: 420px;
    --antt-panel-background: rgba(248, 250, 252, 0.97);
}

/*
 * Page foundation.
 */
html,
body.login {
    width: 100%;
    min-height: 100%;
    margin: 0;
}

body.login {
    position: relative;
    display: flex;
    min-height: 100vh;
    justify-content: flex-end;
    align-items: center;
    padding: 0;
    overflow-x: hidden;
    background:
        linear-gradient(
            90deg,
            rgba(7, 18, 30, 0.08) 0%,
            rgba(7, 18, 30, 0.15) 54%,
            rgba(7, 18, 30, 0.03) 100%
        ),
        url("https://images.unsplash.com/photo-1545805524-7b1a4b0ae73b?q=80&w=2070&auto=format&fit=crop")
        center center / cover no-repeat fixed;
    color: var(--antt-text);
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

/*
 * Right-side light panel.
 */
body.login::after {
    content: "";
    position: fixed;
    z-index: 0;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--antt-panel-width);
    background: var(--antt-panel-background);
    box-shadow: -20px 0 60px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(14px);
    pointer-events: none;
}

/*
 * Native WordPress login container.
 * The whole group is vertically centered by body flex.
 */
#login {
    position: relative;
    z-index: 1;
    width: min(
        var(--antt-form-width),
        calc(var(--antt-panel-width) - 96px)
    );
    margin: 0 clamp(36px, 6vw, 100px) 0 0;
    padding: 0;
    box-sizing: border-box;
}

/*
 * Hide native WordPress logo.
 */
#login > h1 {
    display: none;
}

/*
 * Optional text-based company branding.
 * Keep only if custom-login.php injects .antt-login-brand.
 */
.antt-login-brand {
    margin: 0 0 34px;
    text-align: left;
}

.antt-login-brand a {
    display: inline-flex;
    flex-direction: column;
    color: inherit;
    text-decoration: none;
    box-shadow: none;
}

.antt-login-brand__name {
    color: var(--antt-text);
    font-size: 29px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.045em;
}

.antt-login-brand__name::after {
    content: "";
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-left: 7px;
    border-radius: 50%;
    background: var(--antt-primary);
    vertical-align: 3px;
}

.antt-login-brand__tagline {
    display: none;
}

/*
 * Intro placed directly above the form.
 */
.antt-login-intro {
    margin: 0 0 22px;
    text-align: left;
}

.antt-login-intro h2 {
    margin: 0 0 6px;
    color: var(--antt-text);
    font-size: 28px;
    font-weight: 750;
    line-height: 1.15;
    letter-spacing: -0.035em;
}

.antt-login-intro p {
    margin: 0;
    color: var(--antt-muted);
    font-size: 14px;
    line-height: 1.5;
}

/*
 * Login form.
 */
.login form {
    margin: 0;
    padding: 32px;
    overflow: visible;
    border: 1px solid var(--antt-border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow:
        0 24px 60px rgba(15, 23, 42, 0.08),
        0 3px 12px rgba(15, 23, 42, 0.04);
}

/*
 * Labels.
 */
.login label {
    color: #374151;
    font-size: 13px;
    font-weight: 600;
}

/*
 * Inputs.
 */
.login form .input,
.login input[type="text"],
.login input[type="email"],
.login input[type="password"] {
    width: 100%;
    min-height: 48px;
    margin-top: 8px;
    margin-bottom: 18px;
    padding: 0 14px;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    color: var(--antt-text);
    font-size: 15px;
    box-shadow: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.login form .input:focus,
.login input[type="text"]:focus,
.login input[type="email"]:focus,
.login input[type="password"]:focus {
    border-color: var(--antt-primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(22, 105, 122, 0.13);
}
/*
 * Password field with proper toggle positioning
 */
.login .wp-pwd {
    position: relative;
    margin-top: 6px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
}

.login .wp-pwd input[type="password"] {
    margin-top: 0;
    margin-bottom: 0;
    padding-right: 50px;
    flex: 1;
}

/*
 * Password toggle button - Perfectly centered
 */
.login .button.wp-hide-pw {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    color: #64748b;
    background: transparent;
    border: none;
    padding: 8px;
    margin: 0;
    width: 32px;
    height: 32px;
    min-height: 32px;
    min-width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}

.login .button.wp-hide-pw:hover,
.login .button.wp-hide-pw:focus {
    color: var(--antt-primary);
    background: rgba(22, 105, 122, 0.08);
    outline: none;
    border: none;
    box-shadow: none;
}

.login .button.wp-hide-pw .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/*
 * Password field container fix for proper alignment
 */
.login form .wp-pwd {
    margin-top: 6px;
    margin-bottom: 18px;
}

.login form .wp-pwd .input,
.login form .wp-pwd input[type="password"] {
    margin-top: 0;
    margin-bottom: 0;
}

/*
 * Remember me.
 */
.login form .forgetmenot {
    float: none;
    padding: 20px 0;
}

.login form .forgetmenot label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    color: #526071;
    font-size: 13px;
    font-weight: 500;
}

.login input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    border-color: #cbd5e1;
    border-radius: 5px;
    box-shadow: none;
}

.login input[type="checkbox"]:focus {
    border-color: var(--antt-primary);
    box-shadow: 0 0 0 3px rgba(22, 105, 122, 0.12);
}

/*
 * Submit button.
 */
.login form p.submit {
    clear: both;
    margin: 0;
}

.wp-core-ui #login .button-primary,
.wp-core-ui #login .button.button-large {
    float: none;
    width: 100%;
    min-height: 48px;
    padding: 11px 18px;
    border: 0;
    border-radius: 10px;
    background: var(--antt-primary);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    text-shadow: none;
    box-shadow: none;
    transition:
        background 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.wp-core-ui #login .button-primary:hover,
.wp-core-ui #login .button-primary:focus {
    background: var(--antt-primary-hover);
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(22, 105, 122, 0.22);
    transform: translateY(-1px);
}

/*
 * Notices and errors.
 */
.login .message,
.login .notice,
.login .success,
.login #login_error {
    margin: 0 0 22px;
    padding: 14px 16px;
    border: 0;
    border-left: 4px solid var(--antt-primary);
    border-radius: 9px;
    background: #ecf7f8;
    color: #44505f;
    font-size: 13px;
    line-height: 1.6;
    box-shadow: none;
}

.login #login_error {
    border-left-color: #dc2626;
    background: #fef2f2;
}

/*
 * Navigation links.
 */
.login #nav,
.login #backtoblog {
    padding: 0;
    text-align: center;
}

.login #nav {
    margin: 24px 0 0;
}

.login #backtoblog {
    margin: 13px 0 0;
}

.login #nav a,
.login #backtoblog a,
.login .privacy-policy-page-link a {
    color: var(--antt-muted);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}

.login #nav a:hover,
.login #backtoblog a:hover,
.login .privacy-policy-page-link a:hover {
    color: var(--antt-primary);
}

/*
 * Copyright must be appended inside #login.
 */
.antt-login-copyright {
    width: 100%;
    margin: 68px 0 0;
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}

/*
 * Privacy policy.
 * WordPress may render it outside #login.
 */
.login .privacy-policy-page-link {
    position: fixed;
    z-index: 1;
    right: clamp(36px, 6vw, 100px);
    bottom: 24px;
    width: min(
        var(--antt-form-width),
        calc(var(--antt-panel-width) - 96px)
    );
    margin: 0;
    padding: 0;
    text-align: center;
}

/*
 * Language selector.
 * WordPress may render it outside #login.
 */
.language-switcher {
    position: fixed;
    z-index: 1;
    right: clamp(36px, 6vw, 100px);
    bottom: 52px;
    width: min(
        var(--antt-form-width),
        calc(var(--antt-panel-width) - 96px)
    );
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.language-switcher form {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.language-switcher select {
    min-height: 38px;
    border: 1px solid var(--antt-border);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: none;
}

/*
 * Short desktop screens.
 * Disable vertical centering to avoid clipping long forms.
 */
@media (min-width: 961px) and (max-height: 760px) {
    body.login {
        align-items: flex-start;
    }

    #login {
        margin-top: 36px;
        margin-bottom: 36px;
    }

    .antt-login-brand {
        margin-bottom: 24px;
    }

    .antt-login-intro {
        margin-bottom: 18px;
    }

    .login form {
        padding: 26px;
    }

    .antt-login-copyright {
        margin-top: 36px;
    }

    .language-switcher,
    .login .privacy-policy-page-link {
        position: relative;
        right: auto;
        bottom: auto;
        width: 100%;
        margin-right: clamp(36px, 6vw, 100px);
        margin-left: auto;
    }

    .language-switcher {
        margin-top: 18px;
    }

    .login .privacy-policy-page-link {
        margin-top: 14px;
        margin-bottom: 24px;
    }
}

/*
 * Tablet and mobile.
 */
@media (max-width: 960px) {
    body.login {
        display: block;
        min-height: 100vh;
        background:
            radial-gradient(
                circle at top left,
                rgba(22, 105, 122, 0.13),
                transparent 34%
            ),
            #f1f5f9;
    }

    body.login::after {
        display: none;
    }

    #login {
        width: min(440px, calc(100% - 40px));
        margin: 0 auto;
        padding: 48px 0 28px;
    }

    .language-switcher,
    .login .privacy-policy-page-link {
        position: relative;
        right: auto;
        bottom: auto;
        width: min(440px, calc(100% - 40px));
        max-width: none;
        margin-right: auto;
        margin-left: auto;
    }

    .language-switcher {
        margin-top: 18px;
    }

    .login .privacy-policy-page-link {
        margin-top: 14px;
        margin-bottom: 24px;
    }

    .antt-login-copyright {
        margin-top: 48px;
    }
}

@media (max-width: 520px) {
    #login {
        width: calc(100% - 28px);
        padding-top: 34px;
    }

    .antt-login-brand {
        margin-bottom: 26px;
        padding-left: 4px;
    }

    .antt-login-brand__name {
        font-size: 26px;
    }

    .antt-login-intro h2 {
        font-size: 26px;
    }

    .login form {
        padding: 25px 21px;
        border-radius: 15px;
    }

    .language-switcher,
    .login .privacy-policy-page-link {
        width: calc(100% - 28px);
    }
}
