/* ==========================================================================
   Modern Auth System — Stylesheet
   Brand: Red #cc0000 / Dark #1a1a1a / White #ffffff
   Element-qualified selectors beat Woodmart/WooCommerce high-specificity rules.
   ========================================================================== */

/* ── Box-model reset ────────────────────────────────────────────────────── */

div.mas-account-wrap *,
div.mas-form-container * {
    box-sizing: border-box !important;
}

/* ── Page wrappers ──────────────────────────────────────────────────────── */

div.mas-account-wrap {
    max-width: 640px !important;
    margin: 0 auto !important;
    padding: 0 16px 48px !important;
    font-family: inherit !important;
}

div.mas-form-container {
    max-width: 460px !important;
    margin: 0 auto !important;
    padding: 0 16px 48px !important;
    font-family: inherit !important;
}

/* ── Titles ─────────────────────────────────────────────────────────────── */

div.mas-account-wrap h2.mas-page-title,
div.mas-form-container h2.mas-form-title {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
    margin: 0 0 28px !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    line-height: 1.3 !important;
}

/* ── Cards ──────────────────────────────────────────────────────────────── */

div.mas-account-wrap div.mas-card {
    background: #ffffff !important;
    border: 1px solid #ebebeb !important;
    border-radius: 12px !important;
    padding: 28px 32px !important;
    margin-bottom: 24px !important;
    box-shadow: 0 2px 12px rgba(0,0,0,.06) !important;
}

div.mas-account-wrap div.mas-card-danger {
    border-color: #ffd0d0 !important;
}

div.mas-account-wrap h3.mas-card-title {
    font-size: 13px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: .05em !important;
    color: #cc0000 !important;
    margin: 0 0 12px !important;
    padding: 0 0 12px !important;
    border: none !important;
    border-bottom: 1px solid #f0f0f0 !important;
    background: none !important;
}

div.mas-account-wrap h3.mas-card-title-danger {
    color: #cc0000 !important;
}

div.mas-account-wrap p.mas-card-desc {
    font-size: 13px !important;
    color: #666666 !important;
    margin: 0 0 20px !important;
    padding: 0 !important;
    line-height: 1.5 !important;
}

/* ── Auth form card wrapper ─────────────────────────────────────────────── */

div.mas-form-container form.mas-form {
    background: #ffffff !important;
    border: 1px solid #ebebeb !important;
    border-radius: 12px !important;
    padding: 32px !important;
    box-shadow: 0 2px 12px rgba(0,0,0,.06) !important;
    margin: 0 !important;
    display: block !important;
}

/* ── Labels ─────────────────────────────────────────────────────────────── */

div.mas-account-wrap label.mas-label,
div.mas-account-wrap label.mas-form-label,
div.mas-form-container label.mas-label,
div.mas-form-container label.mas-form-label {
    display: block !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: .05em !important;
    color: #555555 !important;
    margin: 0 0 6px !important;
    padding: 0 !important;
    float: none !important;
    width: auto !important;
    line-height: 1.4 !important;
}

span.mas-label-optional {
    font-weight: 400 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    color: #aaaaaa !important;
    font-size: 11px !important;
}

span.mas-required {
    color: #cc0000 !important;
    margin-left: 2px !important;
}

/* ── Field wrappers ─────────────────────────────────────────────────────── */

div.mas-account-wrap div.mas-field,
div.mas-account-wrap div.mas-form-group,
div.mas-form-container div.mas-field,
div.mas-form-container div.mas-form-group {
    margin: 0 0 20px !important;
    padding: 0 !important;
    float: none !important;
    width: 100% !important;
    clear: both !important;
}

/* ── INPUTS — element-qualified to beat Woodmart ────────────────────────── */

div.mas-form-container input.mas-form-input,
div.mas-form-container input[type="text"].mas-form-input,
div.mas-form-container input[type="email"].mas-form-input,
div.mas-form-container input[type="password"].mas-form-input,
div.mas-form-container input[type="tel"].mas-form-input,
div.mas-form-container select.mas-form-input,
div.mas-account-wrap input.mas-input,
div.mas-account-wrap input[type="text"].mas-input,
div.mas-account-wrap input[type="email"].mas-input,
div.mas-account-wrap input[type="password"].mas-input,
div.mas-account-wrap input[type="tel"].mas-input,
div.mas-account-wrap select.mas-input {
    display: block !important;
    width: 100% !important;
    height: 48px !important;
    padding: 0 16px !important;
    font-size: 15px !important;
    font-family: inherit !important;
    color: #1a1a1a !important;
    background: #fafafa !important;
    background-color: #fafafa !important;
    border: 1.5px solid #e5e5e5 !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    outline: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    margin: 0 !important;
    max-width: none !important;
    min-height: 0 !important;
    float: none !important;
}

div.mas-form-container input.mas-form-input:focus,
div.mas-form-container input[type="text"].mas-form-input:focus,
div.mas-form-container input[type="email"].mas-form-input:focus,
div.mas-form-container input[type="password"].mas-form-input:focus,
div.mas-account-wrap input.mas-input:focus,
div.mas-account-wrap input[type="text"].mas-input:focus,
div.mas-account-wrap input[type="email"].mas-input:focus,
div.mas-account-wrap input[type="password"].mas-input:focus,
div.mas-account-wrap input[type="tel"].mas-input:focus,
div.mas-account-wrap select.mas-input:focus {
    border-color: #cc0000 !important;
    box-shadow: 0 0 0 3px rgba(204,0,0,.08) !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    outline: none !important;
}

div.mas-account-wrap input.mas-input-disabled,
div.mas-account-wrap input.mas-input:disabled,
div.mas-form-container input.mas-form-input:disabled {
    opacity: .55 !important;
    cursor: not-allowed !important;
    background: #f0f0f0 !important;
    background-color: #f0f0f0 !important;
    color: #888888 !important;
}

/* Select arrow */
div.mas-account-wrap select.mas-input,
div.mas-account-wrap select.mas-select {
    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 fill='%23555' d='M6 8L0 0h12z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    padding-right: 36px !important;
    cursor: pointer !important;
}

/* ── Two-column rows ────────────────────────────────────────────────────── */

div.mas-account-wrap div.mas-row-half,
div.mas-account-wrap div.mas-form-row--half,
div.mas-form-container div.mas-row-half,
div.mas-form-container div.mas-form-row--half {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

div.mas-account-wrap div.mas-row-half div.mas-field,
div.mas-account-wrap div.mas-form-row--half div.mas-form-group {
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
}

/* ── BUTTONS — element-qualified ────────────────────────────────────────── */

div.mas-account-wrap button.mas-btn,
div.mas-account-wrap a.mas-btn,
div.mas-form-container button.mas-form-button,
div.mas-form-container a.mas-form-button,
div.mas-form-container input[type="submit"].mas-form-button {
    display: inline-block !important;
    padding: 14px 24px !important;
    height: auto !important;
    min-height: 0 !important;
    background: #cc0000 !important;
    background-color: #cc0000 !important;
    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    font-family: inherit !important;
    text-transform: uppercase !important;
    letter-spacing: .05em !important;
    border: none !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    cursor: pointer !important;
    text-decoration: none !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    width: auto !important;
    float: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    transition: background-color .2s ease, transform .2s ease !important;
    vertical-align: middle !important;
}

div.mas-account-wrap button.mas-btn:hover,
div.mas-account-wrap a.mas-btn:hover,
div.mas-form-container button.mas-form-button:hover,
div.mas-form-container a.mas-form-button:hover {
    background: #aa0000 !important;
    background-color: #aa0000 !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
    text-decoration: none !important;
}

div.mas-account-wrap button.mas-btn:active {
    transform: translateY(0) !important;
}

/* Ghost button */
div.mas-account-wrap button.mas-btn-ghost {
    display: inline-block !important;
    padding: 10px 20px !important;
    height: auto !important;
    background: transparent !important;
    background-color: transparent !important;
    color: #666666 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    border: 1.5px solid #e5e5e5 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    text-decoration: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    transition: border-color .2s ease, color .2s ease !important;
    line-height: 1.4 !important;
}

div.mas-account-wrap button.mas-btn-ghost:hover {
    border-color: #cc0000 !important;
    color: #cc0000 !important;
    background: transparent !important;
}

/* Danger button */
div.mas-account-wrap button.mas-btn-danger {
    background: #991111 !important;
    background-color: #991111 !important;
}

div.mas-account-wrap button.mas-btn-danger:hover {
    background: #7a0d0d !important;
    background-color: #7a0d0d !important;
}

/* ── Messages ───────────────────────────────────────────────────────────── */

div.mas-account-wrap div.mas-message,
div.mas-form-container div.mas-message {
    padding: 14px 18px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    line-height: 1.55 !important;
    margin: 0 0 20px !important;
    border: none !important;
    box-shadow: none !important;
}

div.mas-account-wrap div.mas-success,
div.mas-form-container div.mas-success {
    background: #f0fff4 !important;
    background-color: #f0fff4 !important;
    border-left: 3px solid #00aa44 !important;
    color: #007733 !important;
}

div.mas-account-wrap div.mas-error,
div.mas-form-container div.mas-error {
    background: #fff5f5 !important;
    background-color: #fff5f5 !important;
    border-left: 3px solid #cc0000 !important;
    color: #cc0000 !important;
}

div.mas-account-wrap div.mas-info {
    background: #fffbeb !important;
    background-color: #fffbeb !important;
    border-left: 3px solid #f59e0b !important;
    color: #92400e !important;
}

div.mas-account-wrap div.mas-messages-global {
    margin-bottom: 8px !important;
}

/* Inline AJAX messages */
div.mas-account-wrap div.mas-inline-msg {
    display: none;
    padding: 10px 14px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    margin-top: 12px !important;
    border: none !important;
}

div.mas-account-wrap div.mas-inline-msg.is-success {
    display: block !important;
    background: #f0fff4 !important;
    background-color: #f0fff4 !important;
    border-left: 3px solid #00aa44 !important;
    color: #007733 !important;
}

div.mas-account-wrap div.mas-inline-msg.is-error {
    display: block !important;
    background: #fff5f5 !important;
    background-color: #fff5f5 !important;
    border-left: 3px solid #cc0000 !important;
    color: #cc0000 !important;
}

/* Error list */
div.mas-form-container ul.mas-error-list {
    margin: 0 !important;
    padding-left: 20px !important;
}

div.mas-form-container ul.mas-error-list li {
    margin-bottom: 4px !important;
}

/* ── Avatar section ─────────────────────────────────────────────────────── */

div.mas-account-wrap div.mas-avatar-row {
    display: flex !important;
    align-items: flex-start !important;
    gap: 24px !important;
    flex-wrap: wrap !important;
    margin: 0 !important;
    padding: 0 !important;
}

div.mas-account-wrap div.mas-avatar-preview-wrap {
    flex-shrink: 0 !important;
}

div.mas-account-wrap img.mas-avatar-img {
    display: block !important;
    width: 96px !important;
    height: 96px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 3px solid #e5e5e5 !important;
    box-shadow: none !important;
}

div.mas-account-wrap div.mas-avatar-controls {
    flex: 1 !important;
    min-width: 0 !important;
}

div.mas-account-wrap form.mas-inline-form {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    margin: 0 0 8px !important;
    padding: 0 !important;
}

/* Custom file-input label */
div.mas-account-wrap label.mas-file-label {
    display: inline-block !important;
    padding: 10px 18px !important;
    background: #fafafa !important;
    background-color: #fafafa !important;
    color: #1a1a1a !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    border: 1.5px solid #e5e5e5 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    transition: border-color .2s ease !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

div.mas-account-wrap label.mas-file-label:hover {
    border-color: #cc0000 !important;
}

div.mas-account-wrap input.mas-file-input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ── Hints ──────────────────────────────────────────────────────────────── */

div.mas-account-wrap p.mas-hint,
div.mas-account-wrap p.mas-password-hint,
div.mas-form-container p.mas-hint,
div.mas-form-container p.mas-password-hint {
    font-size: 12px !important;
    color: #999999 !important;
    margin: 6px 0 0 !important;
    padding: 0 !important;
    line-height: 1.5 !important;
}

/* ── Password strength + match ───────────────────────────────────────────── */

div.mas-account-wrap div.mas-strength,
div.mas-form-container div.mas-strength,
div.mas-account-wrap div.mas-password-strength,
div.mas-form-container div.mas-password-strength,
div.mas-account-wrap div.mas-match,
div.mas-form-container div.mas-match,
div.mas-account-wrap div.mas-password-match,
div.mas-form-container div.mas-password-match {
    font-size: 12px !important;
    margin-top: 6px !important;
    min-height: 18px !important;
    line-height: 1.4 !important;
}

.mas-strength-weak   { color: #e53e3e !important; }
.mas-strength-ok     { color: #dd6b20 !important; }
.mas-strength-good   { color: #38a169 !important; }
.mas-strength-strong { color: #2f855a !important; }
.mas-match-ok        { color: #38a169 !important; }
.mas-match-bad       { color: #e53e3e !important; }

/* ── Checkbox row ───────────────────────────────────────────────────────── */

div.mas-form-container div.mas-checkbox-group {
    display: flex !important;
    align-items: center !important;
    margin-bottom: 16px !important;
    float: none !important;
    width: auto !important;
    clear: both !important;
}

div.mas-form-container label.mas-checkbox-label {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 14px !important;
    color: #1a1a1a !important;
    cursor: pointer !important;
    font-weight: normal !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ── Form footer links ──────────────────────────────────────────────────── */

div.mas-form-container div.mas-form-footer {
    margin-top: 20px !important;
    font-size: 13px !important;
    color: #666666 !important;
    text-align: center !important;
}

span.mas-form-separator {
    margin: 0 8px !important;
    color: #cccccc !important;
}

a.mas-form-link {
    color: #cc0000 !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    transition: color .2s ease !important;
}

a.mas-form-link:hover {
    color: #aa0000 !important;
    text-decoration: underline !important;
}

/* ── Logout ─────────────────────────────────────────────────────────────── */

div.mas-logout-container {
    text-align: center !important;
}

/* ── Danger zone ────────────────────────────────────────────────────────── */

div.mas-account-wrap p.mas-danger-warning {
    font-size: 13px !important;
    color: #991111 !important;
    background: #fff5f5 !important;
    border-radius: 6px !important;
    padding: 10px 14px !important;
    margin-bottom: 20px !important;
}

/* ── Responsive (768px) ──────────────────────────────────────────────────── */

@media ( max-width: 768px ) {
    div.mas-account-wrap div.mas-card {
        padding: 20px 18px !important;
    }

    div.mas-account-wrap div.mas-row-half,
    div.mas-account-wrap div.mas-form-row--half,
    div.mas-form-container div.mas-row-half,
    div.mas-form-container div.mas-form-row--half {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }

    div.mas-account-wrap div.mas-avatar-row {
        flex-direction: column !important;
    }

    div.mas-form-container form.mas-form {
        padding: 24px 18px !important;
    }

    div.mas-account-wrap button.mas-btn,
    div.mas-form-container button.mas-form-button {
        width: 100% !important;
        text-align: center !important;
    }
}
