/*
 * W Dobrym Tonie – Custom Login
 * Version 1.1
 * No JavaScript, webfonts or external UI libraries.
 */

:root {
    --wdt-page: #fbfaf8;
    --wdt-page-warm: #faf7f3;
    --wdt-section: #f5eee7;
    --wdt-surface: #ffffff;
    --wdt-text: #242424;
    --wdt-muted: #6e685f;
    --wdt-blue: #24384d;
    --wdt-orange: #ff9000;
    --wdt-coral: #ff512f;
    --wdt-accent-ink: #963c23;
    --wdt-line: rgba(74, 57, 47, .14);
    --wdt-line-strong: rgba(74, 57, 47, .22);
    --wdt-shadow: 0 16px 40px rgba(74, 57, 47, .09), 0 2px 8px rgba(74, 57, 47, .035);
    --wdt-radius: 18px;
    --wdt-control-radius: 8px;
    --wdt-focus: 0 0 0 3px rgba(255, 144, 0, .12);
}

html,
body.login {
    min-height: 100%;
    background:
        radial-gradient(circle at 12% 10%, rgba(255, 144, 0, .045), transparent 28rem),
        radial-gradient(circle at 90% 86%, rgba(255, 81, 47, .035), transparent 26rem),
        linear-gradient(180deg, var(--wdt-page-warm) 0%, var(--wdt-section) 100%);
}

body.login {
    box-sizing: border-box;
    min-height: 100vh;
    margin: 0;
    padding: 32px 20px;
    color: var(--wdt-text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.login * {
    box-sizing: border-box;
}

/*
 * Do not make <body> a flex container. WordPress can append elements such as
 * the language switcher next to #login, which would create a horizontal layout.
 * Center only the actual login wrapper instead.
 */
#login {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: min(100%, 410px);
    min-height: calc(100vh - 64px);
    margin: 0 auto;
    padding: 0;
}

/* Brand / logo */
.login h1 {
    margin: 0 0 25px;
}

.login h1 a {
    display: block;
    width: min(100%, 342px);
    height: 94px;
    margin: 0 auto;
    padding: 0;
    background-image: var(--wdt-login-logo) !important;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    color: transparent;
    font-size: 0;
    line-height: 1;
    text-indent: -9999px;
    overflow: hidden;
}

/* Main card */
.login form {
    position: relative;
    overflow: hidden;
    margin: 0;
    padding: 30px 30px 28px;
    background: rgba(255, 255, 255, .97);
    border: 1px solid var(--wdt-line);
    border-radius: var(--wdt-radius);
    box-shadow: var(--wdt-shadow);
}

.login form::before {
    content: "";
    position: absolute;
    top: 0;
    left: 48px;
    right: 48px;
    height: 2px;
    border-radius: 0 0 999px 999px;
    background: linear-gradient(90deg, transparent, rgba(255, 144, 0, .72) 32%, rgba(255, 81, 47, .68) 68%, transparent);
    opacity: .7;
}

.login label {
    color: #514a44;
    font-size: 13.5px;
    font-weight: 600;
}

.login form .input,
.login input[type="text"],
.login input[type="password"],
.login input[type="email"] {
    min-height: 46px;
    margin: 7px 0 18px;
    padding: 9px 12px;
    color: var(--wdt-text);
    background: var(--wdt-surface);
    border: 1px solid var(--wdt-line-strong);
    border-radius: var(--wdt-control-radius);
    box-shadow: none;
    font-size: 16px;
    line-height: 1.3;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.login form .input:hover,
.login input[type="text"]:hover,
.login input[type="password"]:hover,
.login input[type="email"]:hover {
    border-color: rgba(74, 57, 47, .34);
}

.login form .input:focus,
.login input[type="text"]:focus,
.login input[type="password"]:focus,
.login input[type="email"]:focus {
    border-color: rgba(255, 144, 0, .72);
    box-shadow: var(--wdt-focus);
    outline: none;
}

.login .wp-pwd {
    margin-bottom: 18px;
}

.login .wp-pwd .input {
    margin-bottom: 0;
    padding-right: 44px;
}

.login .button.wp-hide-pw {
    top: 8px;
    right: 4px;
    color: var(--wdt-muted);
}

.login .button.wp-hide-pw:hover,
.login .button.wp-hide-pw:focus {
    color: var(--wdt-accent-ink);
    border: 0;
    box-shadow: none;
}

/* Remember-me + submit row */
.login .forgetmenot {
    display: flex;
    align-items: center;
    min-height: 42px;
}

.login .forgetmenot label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 500;
}

.login input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin: 0;
    border: 1px solid var(--wdt-line-strong);
    border-radius: 4px;
    box-shadow: none;
}

.login input[type="checkbox"]:checked {
    border-color: var(--wdt-blue);
    background: var(--wdt-blue);
}

.login input[type="checkbox"]:checked::before {
    margin: -1px 0 0 -2px;
    color: #fff;
}

.wp-core-ui .button-primary {
    min-height: 42px;
    padding: 0 18px;
    background: var(--wdt-blue);
    border: 1px solid var(--wdt-blue);
    border-radius: 8px;
    box-shadow: none;
    color: #fff;
    font-size: 14px;
    font-weight: 650;
    text-shadow: none;
    transition: transform .14s ease, background .16s ease, box-shadow .16s ease;
}

.wp-core-ui .button-primary:hover,
.wp-core-ui .button-primary:focus {
    background: #1d2f42;
    border-color: #1d2f42;
    box-shadow: 0 5px 14px rgba(36, 56, 77, .16);
    color: #fff;
}

.wp-core-ui .button-primary:active {
    transform: translateY(1px);
}

/* Messages */
.login .message,
.login .notice,
.login #login_error {
    margin: 0 0 18px;
    padding: 13px 15px;
    background: rgba(255, 255, 255, .92);
    border: 1px solid var(--wdt-line);
    border-left: 3px solid var(--wdt-orange);
    border-radius: 8px;
    box-shadow: 0 5px 14px rgba(74, 57, 47, .05);
    color: #514a44;
    font-size: 13px;
    line-height: 1.5;
}

.login #login_error,
.login .notice-error {
    border-left-color: var(--wdt-coral);
}

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

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

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

.login #nav a,
.login #backtoblog a,
.login .privacy-policy-page-link a {
    color: var(--wdt-muted);
    font-size: 13px;
    text-decoration: none;
    transition: color .16s ease;
}

.login #nav a:hover,
.login #nav a:focus,
.login #backtoblog a:hover,
.login #backtoblog a:focus,
.login .privacy-policy-page-link a:hover,
.login .privacy-policy-page-link a:focus {
    color: var(--wdt-accent-ink);
}

.login .privacy-policy-page-link {
    margin: 18px 0 0;
}

/* Defensive fallback: the PHP filter removes this in current WordPress versions. */
.login .language-switcher {
    display: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .login *,
    .login *::before,
    .login *::after {
        scroll-behavior: auto !important;
        transition: none !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

@media (max-width: 480px) {
    body.login {
        padding: 24px 16px;
    }

    #login {
        min-height: calc(100vh - 48px);
    }

    .login h1 {
        margin-bottom: 20px;
    }

    .login h1 a {
        width: min(82vw, 320px);
        height: 82px;
    }

    .login form {
        padding: 26px 22px 24px;
        border-radius: 15px;
    }

    .login form::before {
        left: 32px;
        right: 32px;
    }
}

@media (max-height: 700px) and (min-width: 481px) {
    body.login {
        padding-top: 24px;
        padding-bottom: 24px;
    }

    #login {
        min-height: calc(100vh - 48px);
    }

    .login h1 {
        margin-bottom: 18px;
    }

    .login h1 a {
        height: 72px;
    }

    .login form {
        padding-top: 25px;
        padding-bottom: 24px;
    }
}
