/* ============================================================
   Yo2 Login — Frontend Public Styles  v1.4.0
   ============================================================ */

/* ── Reset & Base ── */
.yo2-page *,
.yo2-page *::before,
.yo2-page *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.yo2-body .site-content .ast-container {
    display: block !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.yo2-page {
    background: var(--yo2-bg, #f5f3ef);
    font-family: var(--yo2-body-font, 'Jost', sans-serif);
    color: var(--yo2-text, #2d2d2d);
    padding: 100px 60px 0px;
    min-height: 100vh;
}

.yo2-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
}

.yo2-wrapper {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.yo2-logo { text-align: center; margin-bottom: 4px; }
.yo2-logo img { max-height: 64px; max-width: 200px; object-fit: contain; }

.yo2-card {
    background: var(--yo2-card-bg, #ffffff);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    padding: 40px 40px 36px;
    width: 100%;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.yo2-notices { width: 100%; }

.yo2-account-type-badge {
    text-align: center;
    font-size: 13px;
    color: var(--yo2-link, #8b6f47);
    margin-bottom: 16px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.yo2-heading {
    font-family: var(--yo2-heading-font, 'Playfair Display', Georgia, serif);
    font-size: 26px;
    font-weight: 600;
    color: var(--yo2-text, #2d2d2d);
    text-align: center;
    margin-bottom: 28px;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.yo2-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

.yo2-input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/*
 * FIX #1 — Selected text not visible.
 * Browsers (especially on macOS/Safari) can render selected text as white-on-white
 * when the page background matches the input background, or when a theme resets
 * `color` to `inherit` and the inherited value has low contrast against the OS
 * selection highlight. We pin the text colour with !important and -webkit-text-fill-color,
 * then explicitly declare ::selection / ::-moz-selection so the highlight is always
 * dark-background / white-text — clearly readable.
 */
.yo2-input {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid #ddd;
    border-radius: 7px;
    font-family: var(--yo2-body-font, 'Jost', sans-serif);
    font-size: 14px;
    color: #2d2d2d !important;
    -webkit-text-fill-color: #2d2d2d;
    caret-color: var(--yo2-accent, #2d2d2d);
    background: #fafafa;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.yo2-input::selection      { background: var(--yo2-accent, #2d2d2d); color: #fff; -webkit-text-fill-color: #fff; }
.yo2-input::-moz-selection { background: var(--yo2-accent, #2d2d2d); color: #fff; }

.yo2-input::placeholder {
    color: #aaa;
    -webkit-text-fill-color: #aaa;
    font-weight: 300;
}

.yo2-input:focus {
    outline: none;
    border-color: var(--yo2-accent, #2d2d2d);
    box-shadow: 0 0 0 3px rgba(45,45,45,0.08);
    background: #fff;
    color: #2d2d2d !important;
    -webkit-text-fill-color: #2d2d2d;
}

/* Autofill — prevent browser blue/yellow wash hiding text */
.yo2-input:-webkit-autofill,
.yo2-input:-webkit-autofill:hover,
.yo2-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #2d2d2d !important;
    -webkit-box-shadow: 0 0 0 1000px #fafafa inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

.yo2-btn {
    display: block;
    width: 100%;
    padding: 14px 20px;
    background: var(--yo2-btn-bg, #2d2d2d);
    color: var(--yo2-btn-text, #ffffff);
    border: none;
    border-radius: 7px;
    font-family: var(--yo2-body-font, 'Jost', sans-serif);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    -webkit-appearance: none;
    appearance: none;
    margin-top: 4px;
}
.yo2-btn:hover     { background: var(--yo2-btn-hover-bg, #8b6f47); color: var(--yo2-btn-hover-text, #ffffff); text-decoration: none; }
.yo2-btn:active    { transform: scale(0.98); }
.yo2-btn:disabled  { opacity: 0.55; cursor: not-allowed; }

.yo2-links-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.yo2-underline-link {
    font-size: 12.5px;
    color: var(--yo2-link, #8b6f47);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s, color 0.2s;
    letter-spacing: 0.01em;
}
.yo2-underline-link:hover { border-bottom-color: var(--yo2-link-hover, #2d2d2d); color: var(--yo2-link-hover, #2d2d2d); }

.yo2-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12.5px;
    color: #666;
    line-height: 1.5;
    cursor: pointer;
}
.yo2-checkbox-label input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    accent-color: var(--yo2-accent, #2d2d2d);
    cursor: pointer;
}

/*
 * FIX #2 — Error message showing twice.
 * .yo2-reg-err is client-side JS only. Server-side WooCommerce errors land in
 * ul.woocommerce-error inside .yo2-notices, which is rendered ABOVE the card.
 * These two blocks never overlap. .yo2-reg-err starts hidden and JS shows it
 * only for JS-detected problems (password mismatch, length). On a full-page
 * reload from WooCommerce validation, JS errors do not fire, so only the
 * WooCommerce notice is shown. No duplication is possible.
 */
.yo2-reg-err {
    display: none;
    padding: 10px 14px;
    background: #fdf0f0;
    border-left: 3px solid #c0392b;
    border-radius: 4px;
    color: #c0392b;
    font-size: 13px;
    line-height: 1.5;
}

ul.woocommerce-error {
    list-style: none !important;
    background: #fdf0f0 !important;
    border-left: 3px solid #c0392b !important;
    border-radius: 6px !important;
    padding: 12px 16px !important;
    margin: 0 0 16px !important;
    font-size: 13px !important;
    color: #c0392b !important;
}
ul.woocommerce-error li::before { display: none !important; }

.woocommerce-message {
    background: #f0fdf4 !important;
    border-left: 3px solid #27ae60 !important;
    border-radius: 6px !important;
    padding: 12px 16px !important;
    margin: 0 0 16px !important;
    font-size: 13px !important;
    color: #27ae60 !important;
}

.yo2-type-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 8px;
}

.yo2-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 28px 16px 22px;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    opacity: 0.75;
    user-select: none;
    outline: none;
}
.yo2-type-card:focus-visible { outline: 2px solid var(--yo2-accent, #2d2d2d); outline-offset: 2px; }
.yo2-type-card[data-type="professional"]:hover {
    background: var(--yo2-type1-hover-bg, #e8e0d5) !important;
    color: var(--yo2-type1-hover-text, #2d2d2d);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    opacity: 1;
}
.yo2-type-card[data-type="individual"]:hover {
    background: var(--yo2-type2-hover-bg, #b8a088) !important;
    color: var(--yo2-type2-hover-text, #2d2d2d);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    opacity: 1;
}
.yo2-type-card.active {
    border-color: var(--yo2-accent, #2d2d2d) !important;
    opacity: 1;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

.yo2-type-icon { width: 120px; height: 120px; display: flex; align-items: center; justify-content: center; }
.yo2-type-icon svg { width: 100%; height: 100%; color: var(--yo2-text, #2d2d2d); }
.yo2-type-label { font-size: 13px; font-weight: 400; letter-spacing: 0.03em; text-align: center; color: var(--yo2-text, #2d2d2d); line-height: 1.4; }

.yo2-pass-wrap { position: relative; }
.yo2-pass-wrap .yo2-input { padding-right: 44px; }
.yo2-eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #aaa;
    font-size: 15px;
    line-height: 1;
    transition: color 0.2s, opacity 0.2s;
    opacity: 0.6;
}
.yo2-eye:hover { color: var(--yo2-text, #2d2d2d); opacity: 1; }

@media (max-width: 1024px) {
    .yo2-page       { padding: 60px 30px; }
    .yo2-container  { padding: 60px 20px; }
    .yo2-wrapper    { max-width: 480px; }
    .yo2-card       { padding: 32px 28px; }
    .yo2-heading    { font-size: 24px; }
    .yo2-type-icon  { width: 100px; height: 100px; }
}

@media (max-width: 768px) {
    .yo2-page       { padding: 80px 20px; }
    .yo2-container  { padding: 40px 10px; }
    .yo2-wrapper    { max-width: 100%; }
    .yo2-card       { padding: 24px 20px; border-radius: 10px; }
    .yo2-heading    { font-size: 22px; margin-bottom: 20px; }
    .yo2-input      { font-size: 14px; padding: 12px 14px; }
    .yo2-btn        { padding: 13px; font-size: 12px; }
    .yo2-type-grid  { grid-template-columns: 1fr; gap: 12px; }
    .yo2-type-icon  { width: 80px; height: 80px; }
    .yo2-input-row  { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .yo2-page       { padding: 30px 10px; }
    .yo2-card       { padding: 20px 16px; }
    .yo2-heading    { font-size: 20px; }
    .yo2-links-row  { flex-direction: column; gap: 10px; }
    .yo2-type-label { font-size: 12px; }
    .yo2-btn        { font-size: 11.5px; letter-spacing: 0.08em; }
}


/* ── Profession select ── */
select.yo2-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

