/*
 * 1.0.6 - My Account rebuilt from the 1.0.5 Auth baseline.
 * Goal: Thinkific-like presentation while keeping WooCommerce's native
 * account form, endpoints, validation, nonces and save handler intact.
 */

/* ---------- Logged-in account shell ---------- */
body.aosc-account-screen:not(.aosc-auth-screen) #content{
  padding-top:70px!important;
  padding-bottom:80px!important;
}
body.aosc-account-screen:not(.aosc-auth-screen) #contentInner{
  width:min(1160px,calc(100% - 56px))!important;
  margin:0 auto!important;
  padding:0!important;
}
body.aosc-account-screen:not(.aosc-auth-screen) .entry-title,
body.aosc-account-screen:not(.aosc-auth-screen) .post > h1,
body.aosc-account-screen:not(.aosc-auth-screen) .st-page-title{
  display:none!important;
}

body.aosc-account-screen:not(.aosc-auth-screen) .woocommerce{
  display:grid!important;
  grid-template-columns:265px minmax(0,1fr)!important;
  column-gap:56px!important;
  align-items:start!important;
  width:100%!important;
  max-width:none!important;
  margin:0!important;
}

/* Woo notices must span the whole account area rather than stealing a grid cell. */
body.aosc-account-screen:not(.aosc-auth-screen) .woocommerce > .woocommerce-notices-wrapper,
body.aosc-account-screen:not(.aosc-auth-screen) .woocommerce > .woocommerce-message,
body.aosc-account-screen:not(.aosc-auth-screen) .woocommerce > .woocommerce-error,
body.aosc-account-screen:not(.aosc-auth-screen) .woocommerce > .woocommerce-info{
  grid-column:1 / -1!important;
}

/* ---------- Left navigation ---------- */
body.aosc-account-screen:not(.aosc-auth-screen) .woocommerce-MyAccount-navigation{
  grid-column:1!important;
  width:265px!important;
  max-width:265px!important;
  float:none!important;
  margin:0!important;
  padding:0!important;
}
body.aosc-account-screen:not(.aosc-auth-screen) .woocommerce-MyAccount-navigation ul{
  list-style:none!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  background:#f7f7f7!important;
}
body.aosc-account-screen:not(.aosc-auth-screen) .woocommerce-MyAccount-navigation li{
  list-style:none!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
}
body.aosc-account-screen:not(.aosc-auth-screen) .woocommerce-MyAccount-navigation li::before,
body.aosc-account-screen:not(.aosc-auth-screen) .woocommerce-MyAccount-navigation li::marker{
  display:none!important;
  content:""!important;
}
body.aosc-account-screen:not(.aosc-auth-screen) .woocommerce-MyAccount-navigation a{
  display:block!important;
  min-height:45px!important;
  padding:10px 16px!important;
  border-left:4px solid transparent!important;
  color:#111!important;
  background:transparent!important;
  font-size:17px!important;
  font-weight:500!important;
  line-height:25px!important;
  text-decoration:none!important;
  box-sizing:border-box!important;
}
body.aosc-account-screen:not(.aosc-auth-screen) .woocommerce-MyAccount-navigation .is-active a{
  border-left-color:#ed1b2f!important;
  color:#ed1b2f!important;
  font-weight:500!important;
}

/* ---------- Right content ---------- */
body.aosc-account-screen:not(.aosc-auth-screen) .woocommerce-MyAccount-content{
  grid-column:2!important;
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  float:none!important;
  margin:0!important;
  padding:0!important;
}

/* Profile endpoint: explicit Thinkific layout.
   The title + avatar are injected by hooks; the actual form stays WooCommerce. */
body.aosc-account-profile-screen .woocommerce-MyAccount-content{
  display:grid!important;
  grid-template-columns:180px minmax(0,1fr)!important;
  grid-template-areas:
    "title title"
    "avatar form"!important;
  column-gap:38px!important;
  align-items:start!important;
}
body.aosc-account-profile-screen .aosc-profile-title{
  grid-area:title!important;
  margin:0 0 30px!important;
  padding:0!important;
  color:#111!important;
  font-size:46px!important;
  line-height:1.15!important;
  font-weight:400!important;
  letter-spacing:-.025em!important;
  white-space:nowrap!important;
}
body.aosc-account-profile-screen .aosc-profile-avatar{
  grid-area:avatar!important;
  margin:0!important;
  padding:0!important;
  text-align:center!important;
}
body.aosc-account-profile-screen .aosc-profile-avatar__image{
  width:150px!important;
  height:150px!important;
  margin:0 auto 12px!important;
  border:2px solid #68717c!important;
  border-radius:50%!important;
  overflow:hidden!important;
  background:#fff!important;
}
body.aosc-account-profile-screen .aosc-profile-avatar__image img{
  display:block!important;
  width:100%!important;
  height:100%!important;
  margin:0!important;
  border-radius:50%!important;
  object-fit:cover!important;
}
body.aosc-account-profile-screen .aosc-profile-avatar__label{
  color:#ff4b16!important;
  font-size:14px!important;
  font-weight:700!important;
  line-height:1.35!important;
}

body.aosc-account-profile-screen form.woocommerce-EditAccountForm{
  grid-area:form!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
  gap:0 18px!important;
  width:100%!important;
  max-width:none!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
}

/* Form ordering to match Thinkific: email, name, surname, company, role, timezone. */
body.aosc-account-profile-screen form.woocommerce-EditAccountForm > p{
  width:100%!important;
  max-width:none!important;
  margin:0 0 20px!important;
  padding:0!important;
  float:none!important;
  box-sizing:border-box!important;
}
body.aosc-account-profile-screen form.woocommerce-EditAccountForm > p:has(#account_email){
  order:1!important;
  grid-column:1 / -1!important;
}
body.aosc-account-profile-screen form.woocommerce-EditAccountForm > p:has(#account_first_name){
  order:2!important;
  grid-column:1!important;
}
body.aosc-account-profile-screen form.woocommerce-EditAccountForm > p:has(#account_last_name){
  order:3!important;
  grid-column:2!important;
}
body.aosc-account-profile-screen form.woocommerce-EditAccountForm > p:has(#account_display_name){
  display:none!important;
}
body.aosc-account-profile-screen form.woocommerce-EditAccountForm > fieldset{
  display:none!important;
}
body.aosc-account-profile-screen .aosc-extra-profile-fields{
  order:4!important;
  grid-column:1 / -1!important;
  display:block!important;
  width:100%!important;
}
body.aosc-account-profile-screen .aosc-extra-profile-fields .form-row{
  width:100%!important;
  max-width:none!important;
  margin:0 0 20px!important;
  padding:0!important;
  float:none!important;
}
body.aosc-account-profile-screen form.woocommerce-EditAccountForm > p:last-of-type{
  order:5!important;
  grid-column:1 / -1!important;
}
body.aosc-account-profile-screen form.woocommerce-EditAccountForm > .clear{
  display:none!important;
}

body.aosc-account-screen:not(.aosc-auth-screen) .woocommerce form label{
  display:block!important;
  margin:0 0 7px!important;
  color:#111!important;
  font-size:14px!important;
  font-weight:700!important;
  line-height:1.4!important;
}
body.aosc-account-screen:not(.aosc-auth-screen) .woocommerce input.input-text,
body.aosc-account-screen:not(.aosc-auth-screen) .woocommerce input[type="email"],
body.aosc-account-screen:not(.aosc-auth-screen) .woocommerce input[type="password"],
body.aosc-account-screen:not(.aosc-auth-screen) .woocommerce select,
body.aosc-account-screen:not(.aosc-auth-screen) .woocommerce textarea{
  display:block!important;
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  height:45px!important;
  min-height:45px!important;
  padding:9px 14px!important;
  border:0!important;
  border-radius:0!important;
  outline:0!important;
  background:#f7f7f7!important;
  color:#111!important;
  box-shadow:none!important;
  font-size:16px!important;
  box-sizing:border-box!important;
}
body.aosc-account-screen:not(.aosc-auth-screen) .woocommerce select{
  appearance:auto!important;
}
body.aosc-account-screen:not(.aosc-auth-screen) .woocommerce button.button,
body.aosc-account-screen:not(.aosc-auth-screen) .woocommerce .button{
  min-height:49px!important;
  padding:11px 22px!important;
  border:0!important;
  border-radius:28px!important;
  background:#ff4b0b!important;
  color:#fff!important;
  box-shadow:none!important;
  font-size:16px!important;
  font-weight:800!important;
  line-height:1.4!important;
}

/* Password section uses the same account shell but only exposes the native
   WooCommerce password controls. The hidden profile fields remain submitted,
   so WooCommerce's own account handler can still validate/save safely. */
body.aosc-account-password-screen .woocommerce-MyAccount-content{
  display:block!important;
}
body.aosc-account-password-screen .aosc-profile-title{
  margin:0 0 34px!important;
  color:#111!important;
  font-size:46px!important;
  line-height:1.15!important;
  font-weight:400!important;
}
body.aosc-account-password-screen form.woocommerce-EditAccountForm{
  width:min(100%,640px)!important;
  margin:0!important;
}
body.aosc-account-password-screen form.woocommerce-EditAccountForm > p,
body.aosc-account-password-screen .aosc-extra-profile-fields{
  display:none!important;
}
body.aosc-account-password-screen form.woocommerce-EditAccountForm > fieldset{
  display:block!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
}
body.aosc-account-password-screen form.woocommerce-EditAccountForm > fieldset legend{
  display:none!important;
}
body.aosc-account-password-screen form.woocommerce-EditAccountForm > fieldset p{
  margin:0 0 20px!important;
}
body.aosc-account-password-screen form.woocommerce-EditAccountForm > p:last-of-type{
  display:block!important;
  margin-top:24px!important;
}

@media(max-width:900px){
  body.aosc-account-screen:not(.aosc-auth-screen) .woocommerce{
    grid-template-columns:220px minmax(0,1fr)!important;
    column-gap:30px!important;
  }
  body.aosc-account-screen:not(.aosc-auth-screen) .woocommerce-MyAccount-navigation{
    width:220px!important;
    max-width:220px!important;
  }
  body.aosc-account-profile-screen .woocommerce-MyAccount-content{
    grid-template-columns:145px minmax(0,1fr)!important;
    column-gap:24px!important;
  }
  body.aosc-account-profile-screen .aosc-profile-title{font-size:38px!important}
  body.aosc-account-profile-screen .aosc-profile-avatar__image{width:125px!important;height:125px!important}
}
@media(max-width:720px){
  body.aosc-account-screen:not(.aosc-auth-screen) #contentInner{
    width:min(100% - 28px,1160px)!important;
  }
  body.aosc-account-screen:not(.aosc-auth-screen) .woocommerce{
    grid-template-columns:1fr!important;
    row-gap:30px!important;
  }
  body.aosc-account-screen:not(.aosc-auth-screen) .woocommerce-MyAccount-navigation,
  body.aosc-account-screen:not(.aosc-auth-screen) .woocommerce-MyAccount-content{
    grid-column:1!important;
    width:100%!important;
    max-width:none!important;
  }
  body.aosc-account-profile-screen .woocommerce-MyAccount-content{
    display:block!important;
  }
  body.aosc-account-profile-screen .aosc-profile-title{
    margin-bottom:24px!important;
    white-space:normal!important;
    font-size:34px!important;
  }
  body.aosc-account-profile-screen .aosc-profile-avatar{
    margin-bottom:28px!important;
    text-align:left!important;
  }
  body.aosc-account-profile-screen .aosc-profile-avatar__image{
    margin-left:0!important;
  }
  body.aosc-account-profile-screen form.woocommerce-EditAccountForm{
    display:block!important;
  }
}

/* ---------- 1.0.5 Auth screen retained unchanged in behavior ---------- */
body.aosc-auth-screen #content,
body.aosc-auth-screen #contentInner,
body.aosc-auth-screen #st-main,
body.aosc-auth-screen #wrapper-in{
  width:100% !important;
  max-width:none !important;
}
body.aosc-auth-screen .aosc-header{min-height:126px}
body.aosc-auth-screen .aosc-header__inner{
  max-width:none;
  min-height:126px;
  padding-left:42px;
  padding-right:42px;
}
body.aosc-auth-screen .aosc-brand__text,
body.aosc-auth-screen .aosc-brand__mark{color:#fff}
body.aosc-auth-screen .aosc-nav--auth{flex:1 1 auto}
body.aosc-auth-screen .aosc-login-link{
  font-size:16px;
  font-weight:800;
  color:#fff!important;
  text-decoration:none!important;
}
body.aosc-auth-screen .woocommerce{
  display:block!important;
  width:min(100% - 40px,620px)!important;
  margin:0 auto!important;
  padding:62px 0 92px;
}
body.aosc-auth-screen .woocommerce > h2,
body.aosc-auth-screen #customer_login > .u-column1 > h2,
body.aosc-auth-screen #customer_login > .u-column2 > h2{display:none!important}
body.aosc-auth-screen .aosc-auth-intro{text-align:center;margin:0 0 40px}
body.aosc-auth-screen .aosc-auth-title{
  margin:0 0 36px;
  color:#111;
  font-size:46px;
  line-height:1.2;
  font-weight:500;
  letter-spacing:.02em;
}
body.aosc-auth-screen .aosc-auth-subtitle{margin:-22px 0 0;color:#6b7280;font-size:14px}
body.aosc-auth-screen #customer_login{display:block!important;width:100%!important;margin:0!important}
body.aosc-auth-screen #customer_login .u-column1,
body.aosc-auth-screen #customer_login .u-column2{
  float:none!important;
  width:100%!important;
  max-width:none!important;
  margin:0!important;
}
body.aosc-auth-screen #customer_login .u-column1[hidden],
body.aosc-auth-screen #customer_login .u-column2[hidden]{display:none!important}
body.aosc-auth-screen .woocommerce form.login,
body.aosc-auth-screen .woocommerce form.register{
  border:0!important;
  padding:0!important;
  margin:0!important;
  border-radius:0!important;
  background:transparent!important;
}
body.aosc-auth-screen .woocommerce form .form-row{margin:0 0 20px!important;padding:0!important}
body.aosc-auth-screen .woocommerce form label{
  display:block;
  margin:0 0 7px;
  color:#111;
  font-size:14px;
  font-weight:800;
}
body.aosc-auth-screen .woocommerce form input.input-text{
  width:100%!important;
  height:46px!important;
  min-height:46px!important;
  padding:10px 14px!important;
  border:0!important;
  border-radius:0!important;
  background:#f7f7f7!important;
  box-shadow:none!important;
  font-size:16px!important;
  color:#111!important;
  box-sizing:border-box!important;
}
body.aosc-auth-screen .woocommerce-form-login__rememberme{
  display:inline-flex!important;
  align-items:center;
  gap:8px;
  float:left;
  margin-top:3px!important;
  font-size:13px!important;
  font-weight:700!important;
}
body.aosc-auth-screen .woocommerce-form-login__rememberme input{width:14px;height:14px;margin:0!important}
body.aosc-auth-screen .woocommerce .lost_password{margin:-54px 0 22px!important;text-align:right}
body.aosc-auth-screen .woocommerce .lost_password a,
body.aosc-auth-screen .aosc-auth-switch a{color:#ff4b16!important;text-decoration:underline!important}
body.aosc-auth-screen .woocommerce button.button,
body.aosc-auth-screen .woocommerce .button{
  min-height:48px;
  padding:10px 24px!important;
  border-radius:28px!important;
  background:#ff4b0b!important;
  color:#fff!important;
  font-size:17px!important;
  font-weight:800!important;
  border:0!important;
  box-shadow:none!important;
}
body.aosc-auth-screen .woocommerce-form-login__submit{clear:both;display:block!important;margin-top:26px!important}
body.aosc-auth-screen .aosc-auth-switch{margin:58px 0 0!important;text-align:center;font-size:15px}
body.aosc-auth-screen .woocommerce-privacy-policy-text{font-size:12px;color:#6b7280}

/* ---------- 1.0.7 wide profile refinement ----------
   Keep the header untouched. Expand only the My Account content area so the
   profile form uses the available horizontal space like the Thinkific reference. */
body.aosc-account-screen:not(.aosc-auth-screen) #contentInner{
  width:min(1240px,calc(100% - 32px))!important;
}
body.aosc-account-screen:not(.aosc-auth-screen) :is(#st-main,.post,.entry-content,.st-entry-content,.woocommerce){
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  margin-left:auto!important;
  margin-right:auto!important;
  float:none!important;
  box-sizing:border-box!important;
}
body.aosc-account-screen:not(.aosc-auth-screen) .woocommerce{
  grid-template-columns:265px minmax(0,1fr)!important;
  column-gap:60px!important;
}
body.aosc-account-profile-screen .woocommerce-MyAccount-content{
  grid-template-columns:180px minmax(0,1fr)!important;
  column-gap:42px!important;
}
body.aosc-account-profile-screen form.woocommerce-EditAccountForm{
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  grid-template-columns:minmax(240px,1fr) minmax(240px,1fr)!important;
  column-gap:18px!important;
}
body.aosc-account-profile-screen form.woocommerce-EditAccountForm > p,
body.aosc-account-profile-screen .aosc-extra-profile-fields,
body.aosc-account-profile-screen .aosc-extra-profile-fields .form-row{
  max-width:none!important;
}
body.aosc-account-profile-screen form.woocommerce-EditAccountForm input,
body.aosc-account-profile-screen form.woocommerce-EditAccountForm select,
body.aosc-account-profile-screen form.woocommerce-EditAccountForm textarea{
  width:100%!important;
  max-width:none!important;
}
@media(max-width:1100px){
  body.aosc-account-screen:not(.aosc-auth-screen) #contentInner{
    width:min(100% - 36px,1160px)!important;
  }
  body.aosc-account-screen:not(.aosc-auth-screen) .woocommerce{
    grid-template-columns:230px minmax(0,1fr)!important;
    column-gap:36px!important;
  }
  body.aosc-account-profile-screen .woocommerce-MyAccount-content{
    grid-template-columns:155px minmax(0,1fr)!important;
    column-gap:28px!important;
  }
  body.aosc-account-profile-screen form.woocommerce-EditAccountForm{
    grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
  }
}

/* ---------- 1.2.9 clean Tutor order history (based on 1.2.8) ---------- */
body.aosc-account-orders-screen .woocommerce-MyAccount-content{
  display:block!important;
  width:100%!important;
  max-width:none!important;
}
body.aosc-account-orders-screen .aosc-order-history{
  width:100%;
  max-width:900px;
  color:#111827;
}
body.aosc-account-orders-screen .aosc-order-history__header{margin:0 0 30px}
body.aosc-account-orders-screen .aosc-order-history__header h1{
  margin:0 0 8px!important;padding:0!important;font-size:40px!important;
  line-height:1.2!important;font-weight:500!important;letter-spacing:-.02em!important;
}
body.aosc-account-orders-screen .aosc-order-history__header p{margin:0!important;color:#64748b;font-size:15px}
body.aosc-account-orders-screen .aosc-order-card{
  margin:0 0 22px;border:1px solid #e2e8f0;border-radius:10px;background:#fff;
  overflow:hidden;box-shadow:0 6px 22px rgba(15,23,42,.05);
}
body.aosc-account-orders-screen .aosc-order-card__top{
  display:flex;align-items:center;justify-content:space-between;gap:20px;
  padding:20px 24px;background:#f8fafc;border-bottom:1px solid #e2e8f0;
}
body.aosc-account-orders-screen .aosc-order-card__top > div:first-child{display:flex;flex-direction:column;gap:4px}
body.aosc-account-orders-screen .aosc-order-card__top strong{font-size:17px}
body.aosc-account-orders-screen .aosc-order-card__top span{color:#64748b;font-size:13px}
body.aosc-account-orders-screen .aosc-order-card__status{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}
body.aosc-account-orders-screen .aosc-order-card__status span{
  display:inline-flex;align-items:center;min-height:29px;padding:4px 10px;border-radius:999px;
  background:#eaf2ff;color:#1d4ed8;font-size:12px;font-weight:700;
}
body.aosc-account-orders-screen .aosc-order-card__items{padding:0 24px}
body.aosc-account-orders-screen .aosc-order-item{
  display:grid;grid-template-columns:minmax(0,1fr) 130px 110px;align-items:center;gap:18px;
  min-height:92px;padding:18px 0;
}
body.aosc-account-orders-screen .aosc-order-item + .aosc-order-item{border-top:1px solid #eef2f7}
body.aosc-account-orders-screen .aosc-order-item__main{display:flex;flex-direction:column;gap:5px;min-width:0}
body.aosc-account-orders-screen .aosc-order-item__main strong{font-size:17px;line-height:1.45}
body.aosc-account-orders-screen .aosc-order-item__main span{color:#64748b;font-size:13px}
body.aosc-account-orders-screen .aosc-order-item__price{text-align:right;white-space:nowrap;font-size:17px;font-weight:800}
body.aosc-account-orders-screen .aosc-order-item__action{
  display:inline-flex;justify-content:center;align-items:center;min-height:39px;padding:8px 13px;
  border:1px solid #1e40af;border-radius:7px;color:#1e40af!important;background:#fff;
  text-decoration:none!important;font-size:13px;font-weight:700;
}
body.aosc-account-orders-screen .aosc-orders-empty,
body.aosc-account-orders-screen .aosc-orders-fallback{
  padding:28px;border:1px solid #e2e8f0;border-radius:10px;background:#fff;
}
body.aosc-account-orders-screen .aosc-orders-fallback__head{margin-bottom:15px}
body.aosc-account-orders-screen .aosc-orders-fallback__head span{color:#64748b;font-size:13px}
body.aosc-account-orders-screen .aosc-orders-fallback .aosc-order-item{grid-template-columns:minmax(0,1fr) 130px 110px}
body.aosc-account-orders-screen .aosc-orders-empty h2,
body.aosc-account-orders-screen .aosc-orders-fallback h2{margin:0 0 8px!important;font-size:21px!important}
body.aosc-account-orders-screen .aosc-orders-empty p{margin:0 0 18px;color:#64748b}
body.aosc-account-orders-screen .aosc-orders-empty a{
  display:inline-flex;padding:10px 18px;border-radius:7px;background:#1e40af;color:#fff!important;
  text-decoration:none!important;font-weight:700;
}
@media(max-width:760px){
  body.aosc-account-orders-screen .aosc-order-history__header h1{font-size:32px!important}
  body.aosc-account-orders-screen .aosc-order-card__top{align-items:flex-start;flex-direction:column}
  body.aosc-account-orders-screen .aosc-order-card__status{justify-content:flex-start}
  body.aosc-account-orders-screen .aosc-order-item,
  body.aosc-account-orders-screen .aosc-orders-fallback .aosc-order-item{grid-template-columns:1fr auto}
  body.aosc-account-orders-screen .aosc-order-item__action{grid-column:1 / -1;width:100%}
}
