/* =========================================
   Manavata Login & Signup - style.css
   ========================================= */

:root {
    --mls-primary: #2271b1;
    --mls-bg: #ffffff;
    --mls-text: #0f172a;
    --mls-muted: #64748b;
    --mls-border: #e2e8f0;
    --mls-card-bg: #f8fafc;
    --mls-radius: 12px;
    --mls-radius-lg: 16px;
    --mls-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

/* =========================================
   Base form layout
   ========================================= */

.mls-form-wrapper {
    max-width: 440px;
    margin: 40px auto;
    padding: 28px;
    background: var(--mls-bg);
    border: 1px solid var(--mls-border);
    border-radius: var(--mls-radius-lg);
    box-shadow: var(--mls-shadow);
}

.mls-form-wrapper h2 {
    margin: 0 0 20px;
    color: var(--mls-text);
    text-align: center;
}

.mls-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

.mls-logo img {
    max-width: 100%;
    object-fit: contain;
}

.mls-form p,
.mls-unlock-form p,
.mls-forgot-form p {
    margin: 0 0 16px;
}

.mls-form label,
.mls-unlock-form label,
.mls-forgot-form label {
    display: block;
    margin-bottom: 6px;
    color: var(--mls-text);
    font-weight: 600;
}

.mls-form input[type="text"],
.mls-form input[type="email"],
.mls-form input[type="password"],
.mls-form input[type="tel"],
.mls-form input[type="date"],
.mls-unlock-form input[type="text"],
.mls-forgot-form input[type="text"],
.mls-profile-edit-form input[type="text"],
.mls-profile-edit-form input[type="date"],
.mls-profile-edit-form input[type="file"] {
    width: 100%;
    padding: 11px 12px;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    color: var(--mls-text);
}

.mls-form input:focus,
.mls-form select:focus,
.mls-unlock-form input:focus,
.mls-forgot-form input:focus,
.mls-profile-edit-form input:focus {
    border-color: var(--mls-primary);
    outline: 2px solid color-mix(in srgb, var(--mls-primary) 20%, transparent);
    outline-offset: 1px;
}

.mls-form select {
    width: 100%;
    padding: 11px 12px;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    color: var(--mls-text);
}

/* =========================================
   Shared buttons
   ========================================= */

.mls-form button,
.mls-unlock-form button,
.mls-forgot-form button {
    padding: 12px;
    border: 0;
    border-radius: 10px;
    background: var(--mls-primary);
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}

.mls-form button:hover,
.mls-unlock-form button:hover,
.mls-forgot-form button:hover,
.mls-button:hover,
.mls-logout-link:hover {
    filter: brightness(0.92);
}

.mls-secondary-button,
.mls-unlock-form button {
    background: #475569 !important;
}

.mls-links {
    margin-top: 16px;
    font-size: 14px;
    text-align: center;
}

.mls-links a {
    color: var(--mls-primary);
    font-weight: 600;
    text-decoration: none;
}

.mls-links a:hover {
    text-decoration: underline;
}

.mls-unlock-form {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--mls-border);
}

/* =========================================
   Notices and validation
   ========================================= */

.mls-notice {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
}

.mls-error {
    border: 1px solid #f5c6c0;
    background: #fdecea;
    color: #8a1f11;
}

.mls-success {
    border: 1px solid #b7e0c3;
    background: #e7f7ed;
    color: #14532d;
}

.mls-field-message {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 600;
}

.mls-field-message.success {
    color: #14532d;
}

.mls-field-message.error {
    color: #b91c1c;
}

.mls-field-help {
    margin: 6px 0 0;
    color: var(--mls-muted);
    font-size: 13px;
}

/* =========================================
   Signup progress and steps
   ========================================= */

.mls-progress {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 22px;
}

.mls-progress-step {
    display: flex;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    font-weight: 700;
}

.mls-progress-step.active {
    background: var(--mls-primary);
    color: #ffffff;
}

.mls-step {
    margin-bottom: 10px;
}

/*
 * Critical:
 * A theme or another CSS rule can override the HTML hidden attribute.
 * This keeps Step 1/2/3 fields and buttons from appearing together.
 */
.mls-signup-form .mls-step[hidden] {
    display: none !important;
}

.mls-signup-form .mls-step:not([hidden]) {
    display: block;
}

.mls-next-button,
.mls-back-button,
.mls-finish-button {
    display: inline-block;
    width: auto !important;
    margin: 0 8px 0 0 !important;
    padding: 10px 18px !important;
    border: 0;
    border-radius: 10px;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}

.mls-next-button,
.mls-finish-button {
    background: var(--mls-primary) !important;
}

.mls-back-button {
    background: #475569 !important;
}

.mls-next-button:hover,
.mls-back-button:hover,
.mls-finish-button:hover {
    filter: brightness(0.9);
}

.mls-optional-note {
    color: var(--mls-muted);
    font-size: 13px;
    text-align: center;
}

/* =========================================
   Phone number field
   ========================================= */

.mls-phone-field {
    display: flex;
    align-items: stretch;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
}

.mls-phone-prefix {
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-right: 1px solid var(--mls-border);
    background: #f1f5f9;
    color: #475569;
    font-weight: 700;
}

.mls-phone-field input {
    flex: 1;
    min-width: 0;
    padding: 11px 12px;
    box-sizing: border-box;
    border: 0;
    outline: 0;
    color: var(--mls-text);
}

/* =========================================
   Interest checkboxes
   ========================================= */

.mls-interest-fieldset {
    margin: 0 0 16px;
    padding: 16px;
    border: 1px solid var(--mls-border);
    border-radius: 12px;
}

.mls-interest-fieldset legend {
    padding: 0 6px;
    color: var(--mls-text);
    font-weight: 700;
}

.mls-interest-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.mls-interest-option {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--mls-text);
    font-weight: 500;
    cursor: pointer;
}

.mls-interest-option input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--mls-primary);
}

/* =========================================
   Profile page
   ========================================= */

.mls-profile-wrapper {
    max-width: 960px;
    margin: 40px auto;
    padding: 28px;
    border: 1px solid var(--mls-border);
    border-radius: var(--mls-radius-lg);
    background: var(--mls-bg);
    box-shadow: var(--mls-shadow);
}

.mls-profile-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--mls-border);
}

.mls-profile-hero-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.mls-profile-avatar {
    display: flex;
    width: 96px;
    height: 96px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 3px solid var(--mls-primary);
    border-radius: 50%;
    background: #eef4fb;
}

.mls-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mls-profile-avatar span {
    color: var(--mls-primary);
    font-size: 38px;
    font-weight: 800;
}

.mls-profile-hero-info h2 {
    margin: 0 0 6px;
    color: var(--mls-text);
    font-size: 28px;
    line-height: 1.2;
}

.mls-profile-email {
    margin: 0 0 12px;
    color: var(--mls-muted);
}

.mls-profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mls-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

.mls-badge-blood {
    background: #fee2e2;
    color: #991b1b;
}

.mls-badge-volunteer {
    background: #dcfce7;
    color: #166534;
}

.mls-profile-hero-actions {
    flex-shrink: 0;
}

.mls-profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.mls-profile-card {
    padding: 20px;
    border: 1px solid var(--mls-border);
    border-radius: 14px;
    background: var(--mls-card-bg);
}

.mls-profile-card-full {
    grid-column: 1 / -1;
}

.mls-profile-card h3 {
    margin: 0 0 14px;
    color: var(--mls-text);
    font-size: 17px;
}

.mls-info-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px dashed #e2e8f0;
}

.mls-info-row:last-child {
    border-bottom: 0;
}

.mls-info-label {
    color: var(--mls-muted);
    font-weight: 600;
}

.mls-info-value {
    color: var(--mls-text);
    font-weight: 600;
    text-align: right;
    overflow-wrap: anywhere;
}

.mls-interest-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.mls-interest-tag {
    padding: 7px 14px;
    border-radius: 999px;
    background: #eef4fb;
    color: var(--mls-primary);
    font-size: 14px;
    font-weight: 700;
}

.mls-empty-text {
    margin: 0;
    color: var(--mls-muted);
}

.mls-profile-footer {
    margin-top: 24px;
    text-align: right;
}

/* =========================================
   Profile buttons and links
   ========================================= */

.mls-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 20px;
    border: 0;
    border-radius: 10px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.mls-button-primary {
    background: var(--mls-primary);
    color: #ffffff;
}

.mls-button-light {
    background: #f1f5f9;
    color: #334155;
}

.mls-logout-link {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 10px;
    background: #475569;
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
}

/* =========================================
   Edit profile
   ========================================= */

.mls-profile-edit-form {
    margin-top: 20px;
}

.mls-edit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.mls-edit-header h2 {
    margin: 0;
    color: var(--mls-text);
}

.mls-profile-edit-form label {
    display: block;
    margin: 14px 0 6px;
    color: var(--mls-text);
    font-weight: 600;
}

.mls-profile-edit-form button {
    padding: 12px 20px;
    border: 0;
    border-radius: 10px;
    background: var(--mls-primary);
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}

.mls-photo-edit {
    display: flex;
    align-items: center;
    gap: 20px;
}

.mls-profile-avatar-large {
    width: 84px;
    height: 84px;
}

.mls-photo-upload {
    flex: 1;
    min-width: 0;
}

.mls-photo-upload label {
    margin: 0 0 6px;
    font-weight: 700;
}

.mls-edit-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}

/* =========================================
   Responsive: tablet
   ========================================= */

@media (max-width: 1024px) {
    .mls-form-wrapper {
        max-width: 520px;
        margin: 30px auto;
        padding: 24px;
    }

    .mls-profile-wrapper {
        max-width: calc(100% - 40px);
        margin: 30px auto;
        padding: 24px;
    }

    .mls-profile-hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
    }

    .mls-profile-hero-actions,
    .mls-profile-hero-actions .mls-button {
        width: 100%;
    }

    .mls-interest-options {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
}

/* =========================================
   Responsive: mobile
   ========================================= */

@media (max-width: 767px) {
    .mls-form-wrapper,
    .mls-profile-wrapper {
        max-width: none;
        margin: 16px 12px;
        padding: 20px;
        border-radius: 14px;
    }

    .mls-form-wrapper h2,
    .mls-profile-wrapper h2 {
        font-size: 22px;
    }

    .mls-form input[type="text"],
    .mls-form input[type="email"],
    .mls-form input[type="password"],
    .mls-form input[type="tel"],
    .mls-form input[type="date"],
    .mls-form select,
    .mls-unlock-form input[type="text"],
    .mls-forgot-form input[type="text"],
    .mls-profile-edit-form input[type="text"],
    .mls-profile-edit-form input[type="date"],
    .mls-profile-edit-form input[type="file"] {
        padding: 12px 14px;
        font-size: 16px;
    }

    .mls-progress {
        gap: 8px;
        margin-bottom: 18px;
    }

    .mls-progress-step {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

    /*
     * Keep only the current step shown.
     * This repeats intentionally in mobile scope in case theme CSS
     * targets mobile elements.
     */
    .mls-signup-form .mls-step[hidden] {
        display: none !important;
    }

    /*
     * Do NOT set generic signup buttons to width:100%.
     * It makes Step 2 Back + Next stack and look like all buttons appear.
     */
    .mls-signup-form .mls-step .mls-next-button,
    .mls-signup-form .mls-step .mls-back-button,
    .mls-signup-form .mls-step .mls-finish-button {
        width: auto !important;
        min-height: 46px;
        margin: 0 8px 8px 0 !important;
        padding: 12px 16px !important;
        font-size: 16px;
    }

    .mls-interest-fieldset {
        padding: 14px;
    }

    .mls-interest-options {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .mls-interest-option {
        align-items: flex-start;
        padding: 10px 12px;
        border: 1px solid var(--mls-border);
        border-radius: 10px;
        background: #ffffff;
    }

    .mls-interest-option input {
        margin-top: 2px;
    }

    .mls-phone-prefix {
        padding: 0 10px;
        font-size: 15px;
    }

    .mls-phone-field input {
        padding: 12px;
        font-size: 16px;
    }

    .mls-profile-hero {
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
        padding-bottom: 20px;
    }

    .mls-profile-hero-left {
        flex-direction: column;
        align-items: center;
        gap: 14px;
        text-align: center;
    }

    .mls-profile-hero-info {
        text-align: center;
    }

    .mls-profile-hero-info h2 {
        font-size: 23px;
    }

    .mls-profile-badges {
        justify-content: center;
    }

    .mls-profile-hero-actions,
    .mls-profile-hero-actions .mls-button {
        width: 100%;
    }

    .mls-profile-grid {
        grid-template-columns: 1fr;
        gap: 14px;
        margin-top: 18px;
    }

    .mls-profile-card {
        padding: 16px;
    }

    .mls-profile-card-full {
        grid-column: auto;
    }

    .mls-info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
        padding: 10px 0;
    }

    .mls-info-label {
        font-size: 13px;
        letter-spacing: 0.03em;
        text-transform: uppercase;
    }

    .mls-info-value {
        font-size: 15px;
        text-align: left;
    }

    .mls-profile-footer {
        text-align: center;
    }

    .mls-logout-link {
        width: 100%;
        box-sizing: border-box;
        text-align: center;
    }

    .mls-edit-header {
        flex-direction: column;
        align-items: stretch;
    }

    .mls-edit-header .mls-button {
        width: 100%;
        box-sizing: border-box;
    }

    .mls-photo-edit {
        flex-direction: column;
        align-items: center;
        gap: 14px;
        text-align: center;
    }

    .mls-photo-upload {
        width: 100%;
    }

    .mls-edit-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .mls-edit-actions .mls-button,
    .mls-edit-actions button {
        width: 100%;
        box-sizing: border-box;
    }
}

/* =========================================
   Responsive: small phones
   ========================================= */

@media (max-width: 400px) {
    .mls-form-wrapper,
    .mls-profile-wrapper {
        margin: 12px 8px;
        padding: 16px;
    }

    .mls-profile-avatar {
        width: 76px;
        height: 76px;
    }

    .mls-profile-avatar span {
        font-size: 28px;
    }

    .mls-profile-hero-info h2 {
        font-size: 21px;
    }

    .mls-profile-card {
        padding: 14px;
    }

    .mls-badge {
        padding: 5px 10px;
        font-size: 12px;
    }

    .mls-interest-tag {
        font-size: 12px;
    }

    .mls-signup-form .mls-step .mls-next-button,
    .mls-signup-form .mls-step .mls-back-button,
    .mls-signup-form .mls-step .mls-finish-button {
        width: 100% !important;
        margin-right: 0 !important;
    }
}

/* Never show inactive signup steps */
#mls-signup-form .mls-step[hidden] {
    display: none !important;
}

/* Navigation buttons for each individual signup step */
#mls-signup-form .mls-step-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

#mls-signup-form .mls-step-actions-end {
    justify-content: flex-end;
}

#mls-signup-form .mls-step-actions button {
    width: auto !important;
    min-width: 120px;
    margin: 0 !important;
}

#mls-signup-form .mls-finish-button {
    padding: 10px 18px;
    border: 0;
    border-radius: 10px;
    background: var(--mls-primary);
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}

@media (max-width: 767px) {
    #mls-signup-form .mls-step-actions {
        gap: 10px;
    }

    #mls-signup-form .mls-step-actions button {
        flex: 1;
        min-width: 0;
        min-height: 46px;
    }
}