/* Authentication Pages - Login / Sign In - Modern Centered Card Design */

/* ManaFresh brand (vendor / delivery / user login when .auth-brand on body) */
body.auth-brand .auth-container {
    background: var(--brand-gradient-hero, linear-gradient(125deg, #FFF7F2 0%, #FFE8E0 45%, #FFF7F2 100%));
    font-family: var(--brand-font, 'Poppins', 'Inter', sans-serif);
}

body.auth-brand .auth-home-link {
    background: rgba(227, 29, 54, 0.08);
    color: var(--brand-primary, #E31D36);
}

body.auth-brand .auth-home-link:hover {
    background: var(--brand-primary, #E31D36);
    color: #fff;
}

body.auth-brand .auth-logo-text {
    color: var(--brand-primary, #E31D36);
}

body.auth-brand .auth-form .form-group input:focus,
body.auth-brand .form-group input:focus,
body.auth-brand .form-group select:focus {
    border-color: var(--brand-primary, #E31D36);
    box-shadow: 0 0 0 3px rgba(227, 29, 54, 0.12);
}

body.auth-brand .auth-forgot-link,
body.auth-brand .checkbox-group a,
body.auth-brand .form-message.info,
body.auth-brand .auth-footer a {
    color: var(--brand-primary, #E31D36);
}

body.auth-brand .btn-submit {
    background: var(--brand-gradient, linear-gradient(135deg, #E31D36, #F25C6D));
    box-shadow: 0 6px 20px rgba(227, 29, 54, 0.3);
}

body.auth-brand .btn-submit:hover {
    box-shadow: 0 8px 28px rgba(227, 29, 54, 0.4);
}

body.auth-brand .checkbox-group input[type="checkbox"] {
    accent-color: var(--brand-primary, #E31D36);
}

body.auth-brand.auth-portal--delivery .btn-submit {
    background: linear-gradient(135deg, #3B3B3B 0%, #5a5a5a 100%);
    box-shadow: 0 6px 20px rgba(59, 59, 59, 0.25);
}

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #f0fdf4, #f8fafc);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    padding: 24px;
    position: relative;
}

/* Auth Card - centered box (login + signup) */
.auth-box {
    max-width: 420px;
    width: 100%;
    background: #fff;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.auth-box--signup {
    max-width: 460px;
}

.other-community-panel[hidden] {
    display: none !important;
}

.other-community-panel {
    margin: 0 0 20px;
    padding: 16px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #f8fafc;
}

.other-community-panel__lead {
    margin: 0 0 14px;
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}

.other-community-steps .form-group {
    margin-bottom: 14px;
}

.other-step-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #94a3b8;
}

.other-step-hint.is-loading {
    color: #64748b;
    font-style: italic;
}

.other-community-panel .form-group:last-child {
    margin-bottom: 0;
}

#otherSocietyGroup[hidden] {
    display: none !important;
}

.other-community-panel select:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    background-color: #f1f5f9;
}


.auth-header {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    padding-top: 48px;
}

/* Home Button - Small top-left pill, above logo */
.auth-home-link {
    position: absolute;
    top: 0;
    left: 0;
    padding: 8px 14px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #16a34a;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s, color 0.2s;
}

.auth-home-link:hover {
    background: #16a34a;
    color: #fff;
}

.auth-home-icon {
    font-size: 14px;
}

/* Logo + Brand */
.auth-logo {
    text-align: center;
    margin-bottom: 20px;
}

.auth-logo-img {
    height: 48px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}

.auth-logo-fallback {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.auth-logo-icon {
    font-size: 32px;
}

.auth-logo-text {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: #16a34a;
    letter-spacing: 0.5px;
}

/* Heading */
.auth-header h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 6px 0;
    text-align: center;
    color: #1f2937;
}

.auth-header p {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 28px 0;
    text-align: center;
}

/* Form */
.auth-form .form-group {
    margin-bottom: 16px;
}

.auth-form .form-group label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
    color: #374151;
}

.required {
    color: #ef4444;
}

.auth-form .form-group input[type="text"],
.auth-form .form-group input[type="email"],
.auth-form .form-group input[type="tel"],
.auth-form .form-group input[type="password"],
.auth-form .form-group select {
    width: 100%;
    height: 46px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 0 14px;
    font-size: 14px;
    background: #fff;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-form .form-group input:focus,
.auth-form .form-group select:focus {
    outline: none;
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

/* Forgot Password - Right aligned, smaller */
.form-group-inline {
    margin-bottom: 20px;
    text-align: right;
}

.auth-forgot-link {
    font-size: 13px;
    color: #16a34a;
    text-decoration: none;
    font-weight: 500;
    display: block;
}

.auth-forgot-link:hover {
    text-decoration: underline;
}

/* Password input wrapper */
.password-input {
    position: relative;
}

.password-input input {
    padding-right: 44px;
    height: 46px;
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    user-select: none;
    font-size: 16px;
    opacity: 0.6;
}

.toggle-password:hover {
    opacity: 1;
}

/* Sign In Button - Modern pill style */
.btn-submit {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, #16a34a, #15803d);
    border-radius: 12px;
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    border: none;
    cursor: pointer;
    transition: transform 0.25s, box-shadow 0.25s;
    margin-top: 8px;
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(22, 163, 74, 0.3);
}

.btn-submit:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* Divider */
.auth-footer {
    margin: 24px 0 0 0;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

/* Sign Up Section */
.auth-footer p {
    font-size: 14px;
    text-align: center;
    color: #6b7280;
    margin: 0;
}

.auth-footer a {
    color: #16a34a;
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Alerts */
.alert {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.alert-error a {
    color: #16a34a;
    font-weight: 600;
    text-decoration: underline;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-success .auth-reset-link {
    color: #16a34a;
    font-weight: 600;
    text-decoration: underline;
}

/* Phone input (signup) */
.phone-input {
    display: flex;
}

.phone-prefix {
    background: #f1f5f9;
    color: #475569;
    padding: 0 14px;
    height: 46px;
    display: flex;
    align-items: center;
    border: 1px solid #e5e7eb;
    border-right: none;
    border-radius: 12px 0 0 12px;
    font-size: 14px;
}

.phone-input input {
    border-radius: 0 12px 12px 0;
    flex: 1;
    height: 46px;
}

/* Checkbox (signup) */
.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 400;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #16a34a;
}

.checkbox-group a {
    color: #16a34a;
    text-decoration: none;
    font-weight: 500;
}

.checkbox-group a:hover {
    text-decoration: underline;
}

.form-message {
    margin-top: 8px;
    font-size: 13px;
}

.form-message.error {
    color: #b91c1c;
}

.form-message.info {
    color: #16a34a;
}

/* Shared form-group (auth + signup) */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
    color: #374151;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="password"],
.form-group select {
    width: 100%;
    height: 46px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0 14px;
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

/* Responsive - Mobile */
@media (max-width: 600px) {
    .auth-container {
        padding: 16px;
    }

    .auth-box.auth-card {
        padding: 24px;
        max-width: 100%;
    }

    .auth-home-link {
        position: relative;
        top: auto;
        left: auto;
        display: inline-flex;
        margin-bottom: 16px;
    }

    .auth-header h2 {
        font-size: 22px;
    }

    .auth-logo-text {
        font-size: 24px;
    }
}
