/* PALMSCMS Login Page — Polished */

:root {
    --palms-primary: #5c3d2e;
    --palms-primary-rgb: 92, 61, 46;
    --palms-secondary: #b88c55;
    --palms-accent: #d9c2a5;
    --palms-dark: #0a0a0a;
    --palms-font: 'Axiforma', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body.login {
    font-family: var(--palms-font);
    background: url('../images/login-bg.jpg') center/cover no-repeat, var(--palms-dark);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 20px;
    overflow: auto;
}

body.login::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 600px 600px at 15% 50%, rgba(155,120,60,0.12) 0%, transparent 70%),
        radial-gradient(ellipse 500px 500px at 85% 20%, rgba(197,153,75,0.08) 0%, transparent 70%),
        radial-gradient(ellipse 400px 400px at 50% 90%, rgba(225,204,161,0.06) 0%, transparent 70%);
    pointer-events: none;
    animation: bgPulse 8s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    0%   { opacity: 0.8; }
    100% { opacity: 1; }
}

body.login::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.15) 0%, transparent 100%),
        radial-gradient(1px 1px at 30% 60%, rgba(255,255,255,0.1) 0%, transparent 100%),
        radial-gradient(1px 1px at 50% 10%, rgba(255,255,255,0.12) 0%, transparent 100%),
        radial-gradient(1px 1px at 70% 40%, rgba(255,255,255,0.08) 0%, transparent 100%),
        radial-gradient(1px 1px at 90% 80%, rgba(255,255,255,0.1) 0%, transparent 100%),
        radial-gradient(1px 1px at 20% 90%, rgba(255,255,255,0.06) 0%, transparent 100%),
        radial-gradient(1px 1px at 60% 70%, rgba(255,255,255,0.08) 0%, transparent 100%),
        radial-gradient(1px 1px at 80% 15%, rgba(255,255,255,0.1) 0%, transparent 100%);
    pointer-events: none;
    animation: twinkle 4s ease-in-out infinite alternate;
}

@keyframes twinkle {
    0%   { opacity: 0.5; }
    100% { opacity: 1; }
}

#login {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    padding-bottom: 24px;
}

/* Card */
#login form {
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow:
        0 25px 60px rgba(0,0,0,0.35),
        0 0 0 1px rgba(255,255,255,0.05) inset,
        0 1px 0 rgba(255,255,255,0.4) inset;
    padding: 44px 36px 36px;
    margin: 0;
    animation: cardIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#loginform {
    padding: 0 !important;
    margin: 0 !important;
}

/* Logo */
.login h1 {
    text-align: center;
    margin-bottom: 28px;
}

.login h1::before {
    content: 'CONTENT MANAGEMENT PLATFORM';
    display: block;
    color: #9ca3af;
    font-family: var(--palms-font);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.16em;
    line-height: 1.4;
    margin-bottom: 12px;
}

.login h1::after {
    content: 'PALMSCMS';
    display: block;
    color: #171717;
    font-family: var(--palms-font);
    font-size: 21px;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.2;
    margin-top: 14px;
}

.login h1 a {
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--palms-primary) 0%, var(--palms-secondary) 100%);
    border-radius: 18px;
    position: relative;
    box-shadow:
        0 8px 24px rgba(var(--palms-primary-rgb), 0.3),
        0 0 0 1px rgba(255,255,255,0.1) inset;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-indent: 0;
    overflow: hidden;
}

.login h1 a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
    border-radius: inherit;
}

    .login h1 a {
        pointer-events: none;
        cursor: default;
        text-decoration: none;
    }
    .login h1 a::after {
    content: 'P';
    position: relative;
    font-family: var(--palms-font);
    font-size: 32px;
    font-weight: 800;
    color: white;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.login h1 a {
    animation: logoIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both;
}

@keyframes logoIn {
    from { opacity: 0; transform: translateY(-10px) scale(0.92); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login h1 a:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow:
        0 14px 32px rgba(var(--palms-primary-rgb), 0.4),
        0 0 0 1px rgba(255,255,255,0.15) inset;
}

.login h1 a:active {
    transform: translateY(-1px) scale(1.02);
    transition-duration: 0.15s;
}

.login h1 a .screen-reader-text {
    display: none;
}

/* Labels */
.login label {
    font-family: var(--palms-font);
    font-weight: 600;
    font-size: 13px;
    color: #374151;
    margin-bottom: 6px;
    display: block;
    letter-spacing: 0.01em;
}

/* Inputs */
.login input[type="text"],
.login input[type="password"],
.login input[type="email"],
.login input[type="url"],
.login input[type="number"],
.login input[type="search"] {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    font-family: var(--palms-font);
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f9fafb;
    box-sizing: border-box;
    -webkit-appearance: none;
    color: #111;
}

.login input[type="text"]:focus,
.login input[type="password"]:focus,
.login input[type="email"]:focus,
.login input[type="url"]:focus,
.login input[type="number"]:focus,
.login input[type="search"]:focus {
    border-color: var(--palms-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(var(--palms-primary-rgb), 0.08);
    outline: none;
}

.login input[type="text"]::placeholder,
.login input[type="password"]::placeholder {
    color: #c0c0c0;
    font-weight: 300;
}

/* Password toggle */
.login .wp-pwd {
    position: relative;
}

.login .wp-pwd input[type="password"] {
    padding-right: 50px;
}

.login .wp-pwd .button.wp-pwd-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #9ca3af;
    transition: color 0.2s ease;
}

.login .wp-pwd .button.wp-pwd-toggle:hover {
    color: var(--palms-primary);
}

/* Submit */
#wp-submit,
.login input[type="submit"] {
    width: 100% !important;
    padding: 13px 24px !important;
    background: linear-gradient(135deg, var(--palms-primary) 0%, var(--palms-secondary) 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 12px !important;
    font-family: var(--palms-font) !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow:
        0 4px 14px rgba(var(--palms-primary-rgb), 0.3),
        0 1px 2px rgba(0,0,0,0.06);
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
}

#wp-submit::before,
.login input[type="submit"]::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#wp-submit:hover,
.login input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 20px rgba(var(--palms-primary-rgb), 0.35),
        0 2px 4px rgba(0,0,0,0.08);
}

#wp-submit:hover::before,
.login input[type="submit"]:hover::before {
    opacity: 1;
}

#wp-submit:active,
.login input[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(var(--palms-primary-rgb), 0.3);
    transition-duration: 0.15s;
}

/* Errors */
.login #login_error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    color: #dc2626;
    padding: 14px 18px;
    margin: 0 0 20px;
    font-family: var(--palms-font);
    font-size: 14px;
    animation: shakeIn 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
    line-height: 1.5;
}

@keyframes shakeIn {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(3px); }
    30%, 50%, 70% { transform: translateX(-4px); }
    40%, 60% { transform: translateX(4px); }
}

/* Messages */
.login .message {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    color: #16a34a;
    padding: 14px 18px;
    margin: 0 0 20px;
    font-family: var(--palms-font);
    font-size: 14px;
    line-height: 1.5;
    animation: fadeSlideIn 0.4s ease;
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Remember me */
.login form .forgetmenot {
    margin-top: 14px;
}

.login form .forgetmenot label {
    font-weight: 400;
    font-size: 13px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.login form .forgetmenot input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--palms-primary);
    cursor: pointer;
}

.login form p.submit {
    margin-top: 24px;
}

.login form p {
    margin-bottom: 18px;
}

/* Nav / Back to blog */
#nav,
#backtoblog {
    text-align: center;
    margin-top: 20px;
}

#nav a,
#backtoblog a {
    color: rgba(255,255,255,0.45);
    text-decoration: none;
    font-family: var(--palms-font);
    font-size: 13px;
    transition: color 0.25s ease;
}

#nav a:hover,
#backtoblog a:hover {
    color: var(--palms-secondary);
}

/* Privacy */
.login .privacy-policy-page-link {
    text-align: center;
    margin-top: 16px;
}

.login .privacy-policy-page-link a {
    color: rgba(255,255,255,0.3);
    font-family: var(--palms-font);
    font-size: 11px;
    transition: color 0.25s ease;
}

.login .privacy-policy-page-link a:hover {
    color: var(--palms-secondary);
}

/* Footer */
.palmscms-login-footer {
    align-items: center;
    color: rgba(255,255,255,0.42);
    display: flex;
    font-family: var(--palms-font);
    font-size: 10px;
    font-weight: 500;
    gap: 8px;
    justify-content: center;
    letter-spacing: 0.1em;
    margin-top: 20px;
    text-transform: uppercase;
    animation: fadeSlideIn 0.5s ease 0.3s both;
}

    .palmscms-login-footer__mark {
        /* hide language selector */
    }
    /* Hide language selector dropdown */
    #language, .language-switcher {
        display: none !important;
    }
    align-items: center;
    background: rgba(197,153,75,0.18);
    border: 1px solid rgba(225,204,161,0.24);
    border-radius: 5px;
    color: var(--palms-accent);
    display: inline-flex;
    font-size: 11px;
    font-weight: 800;
    height: 20px;
    justify-content: center;
    letter-spacing: 0;
    width: 20px;
}

@media (max-width: 480px) {
    body.login {
        align-items: flex-start;
        overflow: auto;
        padding: 28px 16px;
    }

    #login {
        max-width: 100%;
    }

    #login form {
        border-radius: 16px;
        padding: 36px 24px 28px;
    }

    .login h1 a {
        height: 64px;
        width: 64px;
    }
}
