/**
 * IFPO Member Authentication & Portal Styles
 */

/* Container & Wrapper */
.ifpo-auth-wrapper,
.ifpo-dashboard-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1e293b;
    padding: 30px 16px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.ifpo-auth-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.04);
    width: 100%;
    max-width: 580px;
    padding: 36px 36px 30px 36px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

.ifpo-auth-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #851619 0%, #b91c1c 50%, #851619 100%);
}

/* Header */
.ifpo-auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.ifpo-auth-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fef2f2;
    color: #851619;
    border: 1px solid #fee2e2;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.ifpo-auth-title {
    font-family: "Cinzel", Georgia, serif !important;
    font-size: 26px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin: 0 0 8px 0 !important;
    line-height: 1.25 !important;
}

.ifpo-auth-subtitle {
    font-size: 14px;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

/* Tabs */
.ifpo-auth-tabs {
    display: flex;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
    gap: 4px;
}

.ifpo-tab-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: #64748b;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.ifpo-tab-btn:hover {
    color: #0f172a;
}

.ifpo-tab-btn.ifpo-active {
    background: #ffffff;
    color: #851619;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

/* Tab Panes */
.ifpo-tab-pane {
    display: none;
    animation: ifpoFadeIn 0.25s ease forwards;
}

.ifpo-tab-pane.ifpo-active {
    display: block;
}

@keyframes ifpoFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Form Controls */
.ifpo-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ifpo-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.ifpo-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ifpo-label {
    font-size: 13.5px;
    font-weight: 600;
    color: #334155;
    margin: 0;
}

.ifpo-req {
    color: #dc2626;
}

.ifpo-optional {
    color: #94a3b8;
    font-weight: 400;
}

.ifpo-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.ifpo-input-icon {
    position: absolute;
    left: 14px;
    color: #94a3b8;
    pointer-events: none;
}

.ifpo-input,
.ifpo-select {
    width: 100%;
    height: 44px;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    color: #0f172a;
    box-sizing: border-box;
    transition: all 0.2s ease;
    outline: none;
}

.ifpo-input-wrap .ifpo-input {
    padding-left: 40px;
    padding-right: 42px;
}

.ifpo-input:focus,
.ifpo-select:focus {
    border-color: #851619;
    box-shadow: 0 0 0 3px rgba(133, 22, 25, 0.12);
}

.ifpo-toggle-pw {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.15s ease;
}

.ifpo-toggle-pw:hover {
    color: #334155;
}

.ifpo-form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 520px) {
    .ifpo-form-grid-2 {
        grid-template-columns: 1fr;
    }
    .ifpo-auth-card {
        padding: 24px 20px;
    }
}

/* Checkbox & Links */
.ifpo-checkbox-label {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
    line-height: 1.4;
}

.ifpo-checkbox-label input[type="checkbox"] {
    margin-top: 2px;
    cursor: pointer;
    accent-color: #851619;
}

.ifpo-link-subtle {
    font-size: 12.5px;
    color: #851619;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.15s ease;
}

.ifpo-link-subtle:hover {
    text-decoration: underline;
}

.ifpo-link-btn {
    background: none;
    border: none;
    color: #851619;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    padding: 0;
}

.ifpo-link-btn:hover {
    text-decoration: underline;
}

/* Submit Button */
.ifpo-btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 46px;
    background: #851619;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(133, 22, 25, 0.25);
    transition: all 0.2s ease;
    margin-top: 4px;
}

.ifpo-btn-submit:hover {
    background: #6b0d10;
    box-shadow: 0 6px 18px rgba(133, 22, 25, 0.35);
}

.ifpo-btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Spinner */
.ifpo-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: ifpoSpin 0.7s linear infinite;
    display: inline-block;
    margin-left: 8px;
}

@keyframes ifpoSpin {
    to { transform: rotate(360deg); }
}

/* Alerts */
.ifpo-auth-alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    line-height: 1.4;
    margin-bottom: 16px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

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

.ifpo-alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

/* Footer Notice */
.ifpo-auth-footer {
    border-top: 1px solid #f1f5f9;
    padding-top: 18px;
    margin-top: 24px;
    text-align: center;
    font-size: 12.5px;
    color: #64748b;
}

.ifpo-auth-footer a {
    color: #851619;
    font-weight: 700;
    text-decoration: none;
    margin-left: 4px;
}

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

/* ========================================================
   LOGGED-IN MEMBER DASHBOARD STYLES
   ======================================================== */
.ifpo-dashboard-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
    width: 100%;
    max-width: 860px;
    box-sizing: border-box;
    overflow: hidden;
}

.ifpo-dash-hero {
    background: linear-gradient(135deg, #090e1a 0%, #1e293b 100%);
    padding: 32px 36px;
    display: flex;
    align-items: center;
    gap: 20px;
    color: #ffffff;
    border-bottom: 4px solid #851619;
    flex-wrap: wrap;
}

.ifpo-dash-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #851619;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 800;
    border: 3px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.ifpo-dash-user-info {
    flex: 1;
    min-width: 240px;
}

.ifpo-dash-meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    margin-bottom: 6px;
}

.ifpo-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px #22c55e;
}

.ifpo-badge-grade {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 2px 8px;
    font-weight: 700;
}

.ifpo-dash-name {
    font-family: "Cinzel", Georgia, serif !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    margin: 0 0 4px 0 !important;
}

.ifpo-dash-email {
    font-size: 13.5px;
    color: #94a3b8;
    margin: 0;
}

.ifpo-btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.ifpo-btn-logout:hover {
    background: #851619;
    border-color: #851619;
}

/* Dashboard Nav Tabs */
.ifpo-dash-nav {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 24px;
    gap: 16px;
}

.ifpo-dash-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: #64748b;
    padding: 16px 8px;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ifpo-dash-tab-btn:hover {
    color: #0f172a;
}

.ifpo-dash-tab-btn.ifpo-active {
    color: #851619;
    border-bottom-color: #851619;
    font-weight: 700;
}

/* Dashboard Panes */
.ifpo-dash-pane {
    display: none;
    padding: 32px 36px;
}

.ifpo-dash-pane.ifpo-active {
    display: block;
    animation: ifpoFadeIn 0.25s ease forwards;
}

/* Quick Resources Grid */
.ifpo-quick-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 680px) {
    .ifpo-quick-grid {
        grid-template-columns: 1fr;
    }
    .ifpo-dash-pane {
        padding: 24px 20px;
    }
}

.ifpo-resource-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    transition: all 0.2s ease;
}

.ifpo-resource-card:hover {
    border-color: #851619;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(133, 22, 25, 0.1);
}

.ifpo-res-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ifpo-res-red { background: #fef2f2; color: #851619; }
.ifpo-res-blue { background: #eff6ff; color: #2563eb; }
.ifpo-res-amber { background: #fffbeb; color: #d97706; }
.ifpo-res-green { background: #f0fdf4; color: #16a34a; }

.ifpo-res-body h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.ifpo-res-body p {
    margin: 0;
    font-size: 12.5px;
    color: #64748b;
    line-height: 1.4;
}

.ifpo-res-arrow {
    margin-left: auto;
    font-size: 18px;
    color: #94a3b8;
    transition: transform 0.2s ease;
}

.ifpo-resource-card:hover .ifpo-res-arrow {
    color: #851619;
    transform: translateX(4px);
}

.ifpo-section-heading h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.ifpo-section-heading p {
    margin: 0 0 16px 0;
    font-size: 13.5px;
    color: #64748b;
}
