/* ============================================================
   ASHMOOR PARKE — CUSTOM LOGIN PAGE
   Branded login experience for residents and admins
   ============================================================ */

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
    --ap-forest:        #1E3A2F;
    --ap-forest-mid:    #2D5240;
    --ap-forest-light:  #3D6B52;
    --ap-sage:          #6B8F71;
    --ap-charcoal:      #1C1C1C;
    --ap-cream:         #F5F0E8;
    --ap-cream-dark:    #EDE7D9;
    --ap-linen:         #FAF7F2;
    --ap-gold:          #C9A84C;
    --ap-gold-light:    #E2C97E;
    --ap-white:         #FFFFFF;
    --ap-danger:        #C0392B;
    --ap-success:       #27AE60;

    --ap-font-serif:    'Playfair Display', Georgia, serif;
    --ap-font-sans:     'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --ap-radius-sm:     4px;
    --ap-radius-md:     8px;
    --ap-radius-lg:     16px;
    --ap-radius-xl:     32px;
    --ap-radius-full:   9999px;

    --ap-shadow-sm:     0 2px 8px rgba(0,0,0,0.06);
    --ap-shadow-md:     0 8px 32px rgba(0,0,0,0.12);
    --ap-shadow-lg:     0 20px 60px rgba(0,0,0,0.18);

    --ap-transition:    0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================================
   PAGE BACKGROUND
   ============================================================ */
body.login {
    background: var(--ap-forest) !important;
    font-family: var(--ap-font-sans) !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Decorative background pattern */
body.login::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(107, 143, 113, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(201, 168, 76, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(0,0,0,0.2) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* Subtle grid pattern */
body.login::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

/* ============================================================
   LOGIN CONTAINER
   ============================================================ */
#login {
    position: relative;
    z-index: 1;
    width: 420px !important;
    max-width: 90vw;
    padding: 0 !important;
    margin: 0 !important;
    animation: ap-loginFadeIn 0.6s ease-out both;
}

@keyframes ap-loginFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   LOGO / HEADER
   ============================================================ */
#login h1 {
    margin-bottom: 0 !important;
    padding: 0 !important;
}

#login h1 a {
    background-image: none !important;
    width: auto !important;
    height: auto !important;
    margin: 0 auto 8px !important;
    padding: 0 !important;
    text-indent: 0 !important;
    font-family: var(--ap-font-serif) !important;
    font-size: 32px !important;
    font-weight: 700 !important;
    color: var(--ap-white) !important;
    letter-spacing: 0.06em !important;
    text-align: center !important;
    display: block !important;
    line-height: 1.1 !important;
}

#login h1 a::before {
    content: '';
    display: block;
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    background: var(--ap-gold);
    border-radius: var(--ap-radius-md);
    position: relative;
}

#login h1 a::after {
    content: 'AP';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--ap-font-sans);
    font-size: 16px;
    font-weight: 800;
    color: var(--ap-charcoal);
    letter-spacing: 0.05em;
    margin-top: 0;
    line-height: 48px;
    text-align: center;
}

/* Position fix for the pseudo-elements */
#login h1 {
    position: relative;
}

#login h1 a {
    position: relative;
    overflow: visible;
}

/* ============================================================
   WELCOME TEXT (injected via JS)
   ============================================================ */
.ap-login-welcome {
    text-align: center;
    margin-bottom: 28px;
    animation: ap-loginFadeIn 0.6s ease-out 0.15s both;
}

.ap-login-welcome h2 {
    font-family: var(--ap-font-serif) !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    color: var(--ap-white) !important;
    margin: 0 0 8px 0 !important;
    letter-spacing: -0.01em !important;
}

.ap-login-welcome p {
    font-family: var(--ap-font-sans) !important;
    font-size: 14px !important;
    color: rgba(255,255,255,0.55) !important;
    margin: 0 !important;
    letter-spacing: 0.02em !important;
}

/* ============================================================
   LOGIN FORM CARD
   ============================================================ */
#loginform,
#registerform,
#lostpasswordform {
    background: var(--ap-white) !important;
    border: none !important;
    border-radius: var(--ap-radius-xl) !important;
    box-shadow: var(--ap-shadow-lg), 0 0 0 1px rgba(255,255,255,0.05) !important;
    padding: 36px 36px 28px !important;
    margin: 0 !important;
    animation: ap-loginFadeIn 0.6s ease-out 0.2s both;
}

/* Form labels */
#loginform label,
#registerform label,
#lostpasswordform label {
    font-family: var(--ap-font-sans) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
    color: var(--ap-charcoal) !important;
    display: block !important;
    margin-bottom: 6px !important;
}

/* Form inputs */
#loginform input[type="text"],
#loginform input[type="password"],
#registerform input[type="text"],
#registerform input[type="email"],
#registerform input[type="password"],
#lostpasswordform input[type="text"] {
    width: 100% !important;
    padding: 14px 18px !important;
    border: 2px solid rgba(0,0,0,0.08) !important;
    border-radius: var(--ap-radius-md) !important;
    font-family: var(--ap-font-sans) !important;
    font-size: 15px !important;
    color: var(--ap-charcoal) !important;
    background: var(--ap-linen) !important;
    transition: all var(--ap-transition) !important;
    box-shadow: none !important;
    margin-bottom: 4px !important;
    box-sizing: border-box !important;
}

#loginform input[type="text"]:focus,
#loginform input[type="password"]:focus,
#registerform input[type="text"]:focus,
#registerform input[type="email"]:focus,
#registerform input[type="password"]:focus,
#lostpasswordform input[type="text"]:focus {
    border-color: var(--ap-forest) !important;
    background: var(--ap-white) !important;
    box-shadow: 0 0 0 3px rgba(30, 58, 47, 0.1) !important;
    outline: none !important;
}

/* Remember me checkbox */
.forgetmenot {
    margin-top: 4px !important;
}

.forgetmenot label {
    font-size: 13px !important;
    font-weight: 500 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    color: rgba(28,28,28,0.6) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
}

/* Submit button */
#wp-submit,
#loginform .button-primary,
#registerform .button-primary,
#lostpasswordform .button-primary {
    width: 100% !important;
    padding: 14px 24px !important;
    background: var(--ap-forest) !important;
    border: none !important;
    border-radius: var(--ap-radius-md) !important;
    color: var(--ap-white) !important;
    font-family: var(--ap-font-sans) !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    transition: all var(--ap-transition) !important;
    box-shadow: 0 4px 16px rgba(30, 58, 47, 0.25) !important;
    height: auto !important;
    line-height: 1.4 !important;
    margin-top: 8px !important;
    text-shadow: none !important;
}

#wp-submit:hover,
#loginform .button-primary:hover,
#registerform .button-primary:hover,
#lostpasswordform .button-primary:hover {
    background: var(--ap-forest-mid) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 24px rgba(30, 58, 47, 0.35) !important;
}

#wp-submit:focus {
    box-shadow: 0 0 0 3px rgba(30, 58, 47, 0.2), 0 4px 16px rgba(30, 58, 47, 0.25) !important;
}

#wp-submit:active {
    transform: translateY(0) !important;
}

/* Submit row layout */
.submit {
    padding: 0 !important;
    margin-top: 8px !important;
}

/* ============================================================
   NAVIGATION LINKS
   ============================================================ */
#nav,
#backtoblog {
    text-align: center !important;
    margin: 20px 0 0 !important;
    padding: 0 !important;
    animation: ap-loginFadeIn 0.6s ease-out 0.3s both;
}

#nav a,
#backtoblog a {
    font-family: var(--ap-font-sans) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: rgba(255,255,255,0.55) !important;
    text-decoration: none !important;
    transition: color var(--ap-transition) !important;
    letter-spacing: 0.02em !important;
}

#nav a:hover,
#backtoblog a:hover {
    color: var(--ap-gold-light) !important;
}

/* Separator between nav links */
#nav {
    font-size: 13px;
    color: rgba(255,255,255,0.2);
}

/* ============================================================
   ERROR / SUCCESS MESSAGES
   ============================================================ */
#login_error,
.message,
.success {
    border-radius: var(--ap-radius-md) !important;
    border: none !important;
    padding: 14px 20px !important;
    font-family: var(--ap-font-sans) !important;
    font-size: 13px !important;
    margin: 0 0 20px !important;
    box-shadow: var(--ap-shadow-sm) !important;
    animation: ap-loginFadeIn 0.4s ease-out both;
}

#login_error {
    background: rgba(192, 57, 43, 0.08) !important;
    border-left: 4px solid var(--ap-danger) !important;
    color: var(--ap-danger) !important;
}

#login_error a {
    color: var(--ap-danger) !important;
    font-weight: 600 !important;
}

.message {
    background: rgba(30, 58, 47, 0.08) !important;
    border-left: 4px solid var(--ap-forest) !important;
    color: var(--ap-charcoal) !important;
}

.success {
    background: rgba(39, 174, 96, 0.08) !important;
    border-left: 4px solid var(--ap-success) !important;
    color: var(--ap-success) !important;
}

/* ============================================================
   CUSTOM FOOTER
   ============================================================ */
.ap-login-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 20px;
    z-index: 1;
    animation: ap-loginFadeIn 0.6s ease-out 0.5s both;
}

.ap-login-footer p {
    font-family: var(--ap-font-sans);
    font-size: 12px;
    color: rgba(255,255,255,0.25);
    letter-spacing: 0.05em;
    margin: 0;
}

/* ============================================================
   PRIVACY POLICY LINK
   ============================================================ */
.privacy-policy-page-link {
    margin: 16px 0 0 !important;
    text-align: center !important;
}

.privacy-policy-page-link a {
    font-family: var(--ap-font-sans) !important;
    font-size: 12px !important;
    color: rgba(255,255,255,0.3) !important;
    text-decoration: none !important;
}

.privacy-policy-page-link a:hover {
    color: rgba(255,255,255,0.6) !important;
}

/* ============================================================
   LANGUAGE SWITCHER
   ============================================================ */
.language-switcher {
    margin-top: 16px !important;
}

.language-switcher select {
    background: rgba(255,255,255,0.08) !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
    border-radius: var(--ap-radius-md) !important;
    color: rgba(255,255,255,0.7) !important;
    font-family: var(--ap-font-sans) !important;
    padding: 8px 12px !important;
}

/* ============================================================
   PASSWORD STRENGTH METER
   ============================================================ */
#pass-strength-result {
    border-radius: var(--ap-radius-sm) !important;
    font-family: var(--ap-font-sans) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: 0.05em !important;
    padding: 8px 12px !important;
    margin-top: 8px !important;
}

/* ============================================================
   TWO-FACTOR / ADDITIONAL FIELDS
   ============================================================ */
.user-pass-wrap {
    margin-bottom: 8px !important;
}

/* Show/hide password toggle */
.wp-pwd .button.wp-hide-pw {
    color: var(--ap-forest) !important;
    border: none !important;
    background: transparent !important;
}

.wp-pwd .button.wp-hide-pw:hover {
    color: var(--ap-gold) !important;
}

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */
@media screen and (max-width: 480px) {
    #login {
        width: 100% !important;
        max-width: 100vw !important;
    }

    #loginform,
    #registerform,
    #lostpasswordform {
        padding: 28px 24px 24px !important;
        border-radius: var(--ap-radius-lg) !important;
        margin: 0 16px !important;
    }

    #login h1 a {
        font-size: 26px !important;
    }

    .ap-login-welcome h2 {
        font-size: 20px !important;
    }
}

/* ============================================================
   LOADING ANIMATION
   ============================================================ */
@keyframes ap-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

#wp-submit[disabled] {
    animation: ap-pulse 1.5s ease-in-out infinite;
    opacity: 0.7 !important;
}

/* ============================================================
   HIDE DEFAULT WP BRANDING
   ============================================================ */
.login .privacy-policy-page-link {
    margin-bottom: 0 !important;
}

/* Ensure the form sits well on the page */
#login {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#login h1,
.ap-login-welcome,
#login form,
#login #nav,
#login #backtoblog,
#login .message,
#login #login_error {
    width: 100%;
}
