/* --------------------------------------
   Login Box Block Styles (BEM)
   Optimized & Clean
   -------------------------------------- */

/* ---------- Base Wrapper ---------- */
.shaad-login-box-wrap {
    width: 100%;
}

/* ---------- Normal Mode Container ---------- */
.shaad-login-box {
    background: var(--wp--preset--color--surface);
    color: var(--wp--preset--color--text);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.18);
    max-width: 560px;
}

/* ---------- Typography ---------- */
.shaad-login-box__title {
    margin: 0 0 10px;
    font-size: 1.5rem;
    line-height: 1.2;
}

.shaad-login-box__description,
.shaad-login-box__message {
    margin: 0 0 18px;
    opacity: 0.9;
}

/* ---------- Form Elements ---------- */
.shaad-login-box__form form {
    display: grid;
    gap: 14px;
}

.shaad-login-box__form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.shaad-login-box__form input[type="text"],
.shaad-login-box__form input[type="password"],
.shaad-login-box__form input[type="email"] {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: inherit;
    border-radius: 12px;
    padding: 12px 14px;
    outline: none;
}

.shaad-login-box__form .login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.shaad-login-box__form .login-submit {
    margin: 0;
    color: var(--wp--preset--color--logo-base);  /* fixed variable name */
}

/* ---------- Buttons (shared) ---------- */
.shaad-login-box__form .button,
.shaad-login-box__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 12px 18px;
    border: 0;
    border-radius: 999px;
    background: var(--wp--preset--color--primary);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, opacity 0.18s ease, background-color 0.18s ease;
}

.shaad-login-box__form .button:hover,
.shaad-login-box__btn:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.shaad-login-box__btn--secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: inherit;
}

/* ---------- Footer & Links ---------- */
.shaad-login-box__footer {
    margin-top: 16px;
}

.shaad-login-box__footer a {
    color: var(--wp--preset--color--primary);
    text-decoration: none;
}

/* ---------- Logged-in User Card (Normal) ---------- */
.shaad-login-box__user-card {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.shaad-login-box__avatar {
    flex: 0 0 auto;
}

.shaad-login-box__avatar-img,
.shaad-login-box__avatar img {
    display: block;
    width: 72px;
    height: 72px;
    border-radius: 999px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.12);
}

.shaad-login-box__user-meta {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.shaad-login-box__display-name {
    font-size: 1.05rem;
    line-height: 1.2;
}

.shaad-login-box__email {
    opacity: 0.72;
    font-size: 0.92rem;
    word-break: break-word;
}

.shaad-login-box__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* ---------- Compact Mode ---------- */
.shaad-login-box-wrap--compact {
    display: inline-block;
    max-width: 100%;
}

.shaad-login-box--compact {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0;
    max-width: none;
}

/* Compact user row */
.shaad-login-box__compact-user {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    padding: 4px 12px 4px 6px;
    backdrop-filter: blur(4px);
    white-space: nowrap;
}

/* Profile link */
.shaad-login-box__profile-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.shaad-login-box__profile-link:hover {
    color: var(--wp--preset--color--logo-light);
    text-decoration: none;
}

/* Compact avatar */
.shaad-login-box--compact .shaad-login-box__avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.shaad-login-box--compact .shaad-login-box__avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* Compact user meta */
.shaad-login-box--compact .shaad-login-box__user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    gap: 2px;
}

.shaad-login-box--compact .shaad-login-box__display-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
    font-size: 0.9rem;
    font-weight: 600;
}

.shaad-login-box--compact .shaad-login-box__email {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
    font-size: 0.7rem;
    opacity: 0.7;
}

/* Compact logout button */
.shaad-login-box__logout-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: background 0.2s;
    color: inherit;
    text-decoration: none;
    padding: 0;
    line-height: 1;
}

.shaad-login-box__logout-link:hover {
    background: rgba(0, 0, 0, 0.2);
    color: var(--wp--preset--color--logo-light);
    text-decoration: none;
}

.shaad-login-box__logout-link svg {
    width: 18px;
    height: 18px;
}

/* Compact login link (logged-out) */
.shaad-login-box__compact-login-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--wp--preset--color--primary);
    color: #fff;
    border-radius: 999px;
    padding: 8px 18px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s, background 0.2s;
}

.shaad-login-box__compact-login-link:hover {
    background: var(--wp--preset--color--primary-dark);
    transform: translateY(-1px);
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .shaad-login-box {
        padding: 18px;
        border-radius: 16px;
    }
}

@media (max-width: 768px) {
    .shaad-login-box__compact-user .shaad-login-box__user-meta {
        white-space: normal;
    }
}

/* ---------- Header Integration ---------- */
.site-header .header-login-box,
.wp-block-group .header-login-box {
    flex-shrink: 0;
    flex-grow: 0;
    flex-basis: auto;
    min-width: 0;
    max-width: 100%;
}

@media (max-width: 768px) {
    .site-header .header-login-box {
        max-width: 200px;
    }
}