/* =============================================================
   TAD wp-login.php custom styling — Figma-derived
   Overrides the DEFAULT WordPress /wp-login.php routes:
     - login  (default)
     - register
     - lostpassword
     - rp / resetpass
   The child-theme functions.php opens our .tad-auth-page /
   .tad-auth-card wrapper in the `login_header` hook and closes
   it in `login_footer`. WordPress's own <div id="login"> and
   <form id="loginform|registerform|lostpasswordform|resetpassform">
   are rendered INSIDE our .tad-auth-form <section>, so this file
   styles those built-in IDs to fit inside the pill-shape design.

   Do NOT reference .tad-auth-* selectors that assume our custom
   markup for the form fields — WP renders its own <p><label><input>
   layout that we tame here.
   ============================================================= */

/* ---------- Reset the built-in wp-login chrome ---------- */

body.login {
    background: #ffffff;
    margin: 0;
    padding: 0;
    font-family: 'Rethink Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #233454;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    overflow-x: hidden;
}
/* Figma gradient at 137.577deg, stops white 2.19% -> #daf1f3 42.04% -> #40e9ee 180.65%.
   Layer opacity 0.5 in Figma over white base. */
body.login::before {
    content: '';
    position: fixed;
    inset: 0;
    background: linear-gradient(137.577deg, #ffffff 2.19%, #daf1f3 42.04%, #40e9ee 180.65%);
    opacity: 0.5;
    z-index: 0;
    pointer-events: none;
}

/* Hide the WP screen-reader-only heading & backtoblog & privacy link
   (we repurpose backtoblog inside our form column via CSS layout). */
body.login .screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(1px,1px,1px,1px);
    white-space: nowrap;
}
body.login #backtoblog { display: none; }
body.login .privacy-policy-page-link { display: none; }

/* Hide the WP logo — we render our own hero brand + heading. */
body.login .wp-login-logo,
body.login #login h1.wp-login-logo,
body.login h1[role="presentation"].wp-login-logo {
    display: none !important;
}

/* Neutralise WP's #login wrapper (padding/width) — it lives INSIDE
   our .tad-auth-form <section>, so let it fill and add no chrome. */
body.login #login {
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0;
    background: transparent;
}

/* ---------- Our layout wrapper (opened in login_header hook) ---------- */

.tad-auth-page {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1440px;
    min-height: 986px;
    margin: 0 auto;
    padding: 141px 0 40px 236px;
    box-sizing: border-box;
}
.tad-auth-page * { box-sizing: border-box; }

.tad-auth-card {
    position: relative;
    display: grid;
    grid-template-columns: 484px 484.307px;
    width: 968.614px;
    height: 703.849px;
    border-radius: 25px 20px 20px 25px;
    box-shadow: 0 20px 40px rgba(35,52,84,0.08);
}

/* ---------- Hero (left column) ---------- */

.tad-auth-hero {
    position: relative;
    width: 484px;
    height: 703.849px;
    background-color: #08132a;
    background-size: cover;
    background-position: center;
    color: #ffffff;
    border: 5px solid #00abb3;
    border-right: 0;
    border-radius: 25px 0 0 25px;
    overflow: hidden;
}
.tad-auth-hero--login {
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat;
    background-color: #6ea9b8;
}
/* Login hero image has "The Antidote" + "Transformation is Mindset"
   already baked into the raster — hide the CSS text overlays that would
   otherwise duplicate them. */
.tad-auth-hero--login .tad-auth-hero__brand,
.tad-auth-hero--login .tad-auth-hero__tagline {
    display: none !important;
}
/* Login hero: teal gradient overlay at the bottom for tagline legibility */
.tad-auth-hero--login::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 247px;
    background: linear-gradient(to bottom, rgba(0,171,179,0) 4.032%, #00abb3 100%);
    pointer-events: none;
    z-index: 1;
}
/* Subtle top teal cast */
.tad-auth-hero--login::before {
    content: '';
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 140px;
    background: linear-gradient(to bottom, rgba(0,171,179,0.5) 0%, rgba(0,171,179,0) 100%);
    pointer-events: none;
    z-index: 1;
}
.tad-auth-hero--register,
.tad-auth-hero--lost {
    background-size: cover;
    background-position: 50% 50%;
}

.tad-auth-hero__brand {
    position: absolute;
    left: 34px;
    bottom: 40px;
    z-index: 2;
    font-family: 'League Spartan', 'Rethink Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.2px;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.tad-auth-hero__tagline { display: none; margin: 0; }
.tad-auth-hero--login .tad-auth-hero__tagline {
    display: block;
    position: absolute;
    left: 34px;
    bottom: 35px;
    z-index: 2;
    width: 245px;
    font-family: 'Rethink Sans', sans-serif;
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.36px;
    color: #ffffff;
}
.tad-auth-hero--login .tad-auth-hero__brand,
.tad-auth-hero--lost .tad-auth-hero__brand {
    top: 33.55px;
    left: 34.19px;
    bottom: auto;
    font-family: 'League Spartan', sans-serif;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0;
    color: #ffffff;
    z-index: 2;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
/* Login raster has "The Antidote" baked in — hide overlay. Recovery raster does NOT. */
.tad-auth-hero--login .tad-auth-hero__brand {
    display: none !important;
}

/* ---------- Form column (right) ---------- */

.tad-auth-form {
    position: relative;
    width: 484.307px;
    height: 703.849px;
    background: #ffffff;
    border: 5px solid #00abb3;
    border-left: 0;
    border-radius: 0 20px 20px 0;
    padding: 32px 47px 32px 47px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tad-auth-form__heading {
    margin: 0;
    padding: 0;
    font-family: 'Rethink Sans', sans-serif;
    font-size: 40px;
    font-weight: 600;
    letter-spacing: -1.2px;
    line-height: 1.15;
    color: #233454;
}
.tad-auth-form__heading .accent { color: #00abb3; }

.tad-auth-form__lead {
    margin: 8px 0 4px 0;
    padding: 0;
    font-family: 'League Spartan', 'Rethink Sans', sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.42;
    letter-spacing: -0.18px;
    color: rgba(35,52,84,0.75);
}

/* ---------- Field wrap with left icon (SVG inline via data URI) ---------- */

/* Screen-reader-only helper for custom register fields whose labels are
   visually hidden but must remain accessible to AT. */
body.login .tad-sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(1px,1px,1px,1px);
    white-space: nowrap;
}

/* Wrapper is either a WP-native <p> that JS retrofits with the class, or a
   <p> our register_form hook renders directly. Either way, position:relative
   so the ::before icon anchors to the input's left edge. */
body.login .tad-auth-field-wrap {
    position: relative;
    margin: 0 0 10px 0;
}
body.login .tad-auth-field-wrap[data-icon]::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    z-index: 2;
    pointer-events: none;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px 20px;
}
/* Push input text/placeholder right of the icon */
body.login .tad-auth-field-wrap input[type=text],
body.login .tad-auth-field-wrap input[type=email],
body.login .tad-auth-field-wrap input[type=password],
body.login .tad-auth-field-wrap input[type=tel] {
    padding-left: 50px;
}
/* Password field with WP eye toggle needs padding on BOTH sides */
body.login .tad-auth-field-wrap.user-pass-wrap .wp-pwd input[type=password],
body.login .tad-auth-field-wrap.user-pass-wrap .wp-pwd input[type=text] {
    padding-left: 50px;
    padding-right: 52px;
}

/* Icon variants — SVGs are stroke-based, 20x20 viewBox, teal (#00abb3) */
body.login .tad-auth-field-wrap[data-icon="mail"]::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2300abb3' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><rect x='2.5' y='4' width='15' height='12' rx='2'/><path d='M2.5 5.5l7.5 5.5 7.5-5.5'/></svg>");
}
body.login .tad-auth-field-wrap[data-icon="lock"]::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2300abb3' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><rect x='3.5' y='9' width='13' height='8' rx='2'/><path d='M6 9V6.5a4 4 0 0 1 8 0V9'/></svg>");
}
body.login .tad-auth-field-wrap[data-icon="lock-check"]::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2300abb3' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><rect x='3.5' y='9' width='13' height='8' rx='2'/><path d='M6 9V6.5a4 4 0 0 1 8 0V9'/><path d='M8 13l1.5 1.5L12 12'/></svg>");
}
body.login .tad-auth-field-wrap[data-icon="user"]::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2300abb3' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><circle cx='10' cy='7' r='3.2'/><path d='M4 17c1.2-3 3.6-4.5 6-4.5s4.8 1.5 6 4.5'/></svg>");
}
body.login .tad-auth-field-wrap[data-icon="phone"]::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2300abb3' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><path d='M5.5 3.5h3l1.2 3-1.6 1.2a10 10 0 0 0 4.2 4.2l1.2-1.6 3 1.2v3a1.5 1.5 0 0 1-1.6 1.5A13 13 0 0 1 4 5.1 1.5 1.5 0 0 1 5.5 3.5z'/></svg>");
}
body.login .tad-auth-field-wrap[data-icon="globe"]::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2300abb3' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><circle cx='10' cy='10' r='7'/><path d='M3 10h14M10 3c2.5 3 2.5 11 0 14M10 3c-2.5 3-2.5 11 0 14'/></svg>");
}

/* Phone row: country code (narrow) + number (wide) side-by-side */
body.login .tad-phone-row {
    display: flex;
    gap: 10px;
    margin: 0 0 10px 0;
}
body.login .tad-phone-row .tad-auth-field-wrap {
    margin: 0;
}
body.login .tad-phone-row .tad-field-phone-country {
    flex: 0 0 96px;
}
body.login .tad-phone-row .tad-field-phone-country input {
    padding-left: 44px;
    padding-right: 8px;
    text-align: center;
}
body.login .tad-phone-row .tad-field-phone-country[data-icon]::before {
    left: 12px;
}
body.login .tad-phone-row .tad-field-phone-number {
    flex: 1 1 auto;
}

/* Hide the WP-generated username field on register (we derive from email);
   also handled in JS by removing the row visually. */
body.login #registerform .user-login-wrap,
body.login #registerform p.login-username {
    display: none;
}
/* Hide WP's default "Register For This Site" notice — our heading/lead provide the context. */
body.login .message.register {
    display: none;
}
/* Hide the "Registration confirmation will be emailed to you." helper text on
   the register page — we accept a password directly, so the copy is misleading. */
body.login #registerform #reg_passmail {
    display: none;
}

/* ---------- Style WP's actual forms as pill inputs ---------- */

/* Universal form reset: remove default WP <p> wrappers' margins */
body.login #loginform,
body.login #registerform,
body.login #lostpasswordform,
body.login #resetpassform {
    margin: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    border: 0;
    overflow: visible;
}
body.login #loginform > p,
body.login #registerform > p,
body.login #lostpasswordform > p,
body.login #resetpassform > p,
body.login .user-pass-wrap,
body.login .user-pass2-wrap {
    margin: 0 0 10px 0;
    padding: 0;
    position: relative;
}

/* Hide the labels that duplicate placeholder text — we use placeholder-only design */
body.login #loginform label[for="user_login"],
body.login #loginform label[for="user_pass"],
body.login #registerform label[for="user_login"],
body.login #registerform label[for="user_email"],
body.login #lostpasswordform label[for="user_login"],
body.login #resetpassform label[for="pass1"],
body.login #resetpassform label[for="pass2"] {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(1px,1px,1px,1px);
    white-space: nowrap;
}

/* Pill-shape inputs */
body.login input[type=text],
body.login input[type=email],
body.login input[type=password],
body.login input[type=tel] {
    display: block;
    width: 100%;
    height: 51px;
    padding: 0 20px;
    margin: 0;
    background: #ffffff;
    border: 1px solid rgba(0,171,179,0.5);
    border-radius: 100px;
    font-family: 'Rethink Sans', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.2;
    color: #233454;
    letter-spacing: -0.14px;
    box-shadow: none;
    outline: 0;
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
body.login input[type=text]::placeholder,
body.login input[type=email]::placeholder,
body.login input[type=password]::placeholder,
body.login input[type=tel]::placeholder {
    color: rgba(35,52,84,0.75);
    opacity: 1;
}
body.login input[type=text]:focus,
body.login input[type=email]:focus,
body.login input[type=password]:focus,
body.login input[type=tel]:focus {
    border-color: #00abb3;
    box-shadow: 0 0 0 3px rgba(0,171,179,0.15);
}

/* Password wrap — WP nests input inside .wp-pwd for the eye toggle */
body.login .wp-pwd {
    position: relative;
}
body.login .wp-pwd input[type=password],
body.login .wp-pwd input[type=text] {
    padding-right: 52px; /* room for the eye button */
}
body.login .wp-pwd .button.wp-hide-pw {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    color: rgba(35,52,84,0.6);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}
body.login .wp-pwd .button.wp-hide-pw:hover,
body.login .wp-pwd .button.wp-hide-pw:focus {
    color: #00abb3;
    background: transparent;
    outline: 0;
}
body.login .wp-pwd .button.wp-hide-pw .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* "Remember Me" — keep visible on login, subtle */
body.login .forgetmenot {
    margin: 4px 0 0 0 !important;
    padding: 0;
    font-family: 'Rethink Sans', sans-serif;
    font-size: 12px;
    letter-spacing: -0.12px;
    color: rgba(35,52,84,0.75);
    display: flex;
    align-items: center;
    gap: 8px;
}
body.login .forgetmenot input[type=checkbox] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #00abb3;
    border: 1px solid rgba(0,171,179,0.5);
    border-radius: 4px;
    background: #ffffff;
    cursor: pointer;
    -webkit-appearance: checkbox;
    appearance: checkbox;
    box-shadow: none;
}
body.login .forgetmenot label {
    color: rgba(35,52,84,0.75);
    cursor: pointer;
    margin: 0;
}

/* ---------- Submit button (WP: .button-primary.button-large) ---------- */

body.login .submit {
    margin: 14px 0 0 0 !important;
    padding: 0;
    text-align: left;
}
body.login .wp-core-ui .button-primary,
body.login .button.button-primary.button-large,
body.login input[type=submit].button-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 51px;
    padding: 16px 24px;
    border-radius: 100px;
    background: #00abb3 !important;
    color: #ffffff !important;
    border: 1px solid #00abb3 !important;
    font-family: 'League Spartan', sans-serif;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -0.36px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    box-shadow: none !important;
    text-shadow: none !important;
    float: none;
    transition: opacity 0.15s;
    box-sizing: border-box;
}
body.login .wp-core-ui .button-primary:hover,
body.login .button.button-primary.button-large:hover {
    background: #00abb3 !important;
    opacity: 0.9;
}
body.login .wp-core-ui .button-primary:focus {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(0,171,179,0.25) !important;
}

/* ---------- Register disclaimer + Back-to-Login button ---------- */

body.login .tad-auth-disclaimer {
    margin: 20px 0 12px 0;
    padding: 0;
    font-family: 'Rethink Sans', sans-serif;
    font-size: 12px;
    line-height: 1.4;
    color: rgba(35,52,84,0.75);
    text-align: center;
}
body.login .tad-auth-disclaimer a {
    color: #233454;
    text-decoration: underline;
}
body.login .tad-auth-back-wrap {
    margin: 10px 0 0 0;
    padding: 0;
    text-align: left;
}
body.login .tad-auth-btn.tad-auth-btn--outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 51px;
    padding: 16px 24px;
    border-radius: 100px;
    background: #ffffff;
    color: rgba(35,52,84,0.75);
    border: 1px solid rgba(35,52,84,0.3);
    font-family: 'League Spartan', sans-serif;
    font-size: 16px;
    font-weight: 400;
    letter-spacing: -0.32px;
    line-height: 1;
    text-decoration: none;
    box-sizing: border-box;
    transition: background 0.15s, border-color 0.15s;
}
body.login .tad-auth-btn.tad-auth-btn--outline:hover {
    background: #f7fafb;
    border-color: rgba(35,52,84,0.5);
}

/* ---------- #nav (Register / Lost password links) ---------- */

body.login #nav {
    margin: 14px 0 0 0;
    padding: 0;
    font-family: 'Rethink Sans', sans-serif;
    font-size: 12px;
    letter-spacing: -0.12px;
    color: rgba(35,52,84,0.75);
    text-align: center;
    line-height: 1.5;
}
body.login #nav a {
    color: #233454;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}
body.login #nav a:hover,
body.login #nav a:focus {
    color: #00abb3;
}

/* ---------- Login page: inline links row (Register on left, Lost pw on right) ---------- */

.tad-auth-form--login #nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}
.tad-auth-form--login #nav .wp-login-register {
    margin-right: auto;
}

/* ---------- WP login/message notices ---------- */

body.login .message,
body.login .success,
body.login #login_error {
    margin: 0 0 12px 0;
    padding: 12px 16px;
    border-radius: 12px;
    font-family: 'Rethink Sans', sans-serif;
    font-size: 13px;
    line-height: 1.4;
    color: #233454;
    background: #f2fafa;
    border-left: 4px solid #00abb3;
    box-shadow: none;
    word-break: break-word;
}
body.login #login_error {
    background: #fdecea;
    border-left-color: #d63638;
    color: #611a1c;
}

/* ---------- Password strength meter (register + rp) ---------- */
body.login .indicator-hint,
body.login #pass-strength-result {
    font-family: 'Rethink Sans', sans-serif;
    font-size: 12px;
    color: rgba(35,52,84,0.75);
    text-align: left;
    margin: 6px 0 0 0;
    padding: 6px 12px;
    border-radius: 8px;
    background: transparent;
    border: 0;
}
body.login #pass-strength-result.short { color: #d63638; }
body.login #pass-strength-result.bad   { color: #dba617; }
body.login #pass-strength-result.good  { color: #007cba; }
body.login #pass-strength-result.strong { color: #00abb3; }

/* Confirm-weak checkbox row (rp) */
body.login .pw-weak {
    margin: 8px 0 0 0;
    font-family: 'Rethink Sans', sans-serif;
    font-size: 12px;
    color: rgba(35,52,84,0.75);
}

/* ---------- Language switcher (WP outputs .language-switcher after form) ---------- */
body.login .language-switcher {
    display: none;
}

/* ---------- Interstitial "Check your email" screen (registered/lostpassword) ---------- */
body.login .login .message + p,
body.login #login .message + p {
    font-family: 'Rethink Sans', sans-serif;
    font-size: 14px;
    color: rgba(35,52,84,0.75);
    line-height: 1.5;
    margin: 0 0 12px 0;
}

/* =============================================================
   Responsive — mobile-first fallback below 900px
   Card stacks: hero on top (compact), form below full-width.
   ============================================================= */

@media (max-width: 899px) {
    .tad-auth-page {
        padding: 24px;
        min-height: 100vh;
        max-width: 100%;
    }
    .tad-auth-card {
        display: block;
        grid-template-columns: 1fr;
        width: 100%;
        max-width: 460px;
        height: auto;
        margin: 0 auto;
        border-radius: 25px;
    }
    .tad-auth-hero {
        width: 100%;
        max-width: 100%;
        height: 180px;
        border: 5px solid #00abb3;
        border-bottom: 0;
        border-radius: 25px 25px 0 0;
    }
    .tad-auth-hero__brand {
        left: 24px;
        bottom: 24px;
    }
    .tad-auth-hero--login {
        height: 220px;
    }
    .tad-auth-hero--login .tad-auth-hero__brand {
        top: 16px;
        left: 20px;
    }
    .tad-auth-hero--login .tad-auth-hero__tagline {
        left: 20px;
        bottom: 20px;
        width: auto;
        max-width: 70%;
        font-size: 24px;
        letter-spacing: -0.24px;
    }
    .tad-auth-hero--login::before { height: 60px; }
    .tad-auth-hero--login::after  { height: 110px; }

    .tad-auth-form {
        position: relative;
        width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 500px;
        padding: 28px 24px 32px 24px;
        border: 5px solid #00abb3;
        border-top: 0;
        border-radius: 0 0 25px 25px;
        overflow: visible;
    }
    .tad-auth-form__heading {
        font-size: 28px;
        letter-spacing: -0.84px;
    }
    .tad-auth-form__lead {
        font-size: 15px;
        margin-bottom: 6px;
    }

    /* On mobile, keep login nav row centered */
    .tad-auth-form--login #nav {
        flex-direction: column;
        gap: 6px;
        text-align: center;
    }
}
